diff options
author | kotfu <kotfu@kotfu.net> | 2019-11-29 23:51:12 -0700 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2019-11-29 23:51:12 -0700 |
commit | 52f4275ff0fd1af90b1786c229de2c6fd845ec0e (patch) | |
tree | 5fca419ba6e3484d24fb47db8724e1a12fbf261d /docs/features/builtin_commands.rst | |
parent | 4bc02bb8b33c6d15e1e65ba68608c5b1cc678411 (diff) | |
download | cmd2-git-52f4275ff0fd1af90b1786c229de2c6fd845ec0e.tar.gz |
Finish documenting settings and add new builtin_commands document
Diffstat (limited to 'docs/features/builtin_commands.rst')
-rw-r--r-- | docs/features/builtin_commands.rst | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/docs/features/builtin_commands.rst b/docs/features/builtin_commands.rst new file mode 100644 index 00000000..ab4ca60e --- /dev/null +++ b/docs/features/builtin_commands.rst @@ -0,0 +1,48 @@ +Builtin Commands +================ + +Applications which subclass :class:`cmd2.cmd2.Cmd` inherit a number of commands +which may be useful to your users. + +edit +---- + +This command launches an editor program and instructs it to open the given file +name. Here's an example:: + + (Cmd) edit ~/.ssh/config + +The program to be launched is determined by the value of the +:ref:`features/settings:editor` setting. + + +set +--- + +A list of all user-settable parameters, with brief comments, is viewable from +within a running application:: + + (Cmd) set --long + allow_ansi: Terminal # Allow ANSI escape sequences in output (valid values: Terminal, Always, Never) + continuation_prompt: > # On 2nd+ line of input + debug: False # Show full error stack on error + echo: False # Echo command issued into output + editor: vim # Program used by ``edit`` + feedback_to_output: False # include nonessentials in `|`, `>` results + locals_in_py: False # Allow access to your application in py via self + max_completion_items: 50 # Maximum number of CompletionItems to display during tab completion + prompt: (Cmd) # The prompt issued to solicit input + quiet: False # Don't print nonessential feedback + timing: False # Report execution times + +Any of these user-settable parameters can be set while running your app with +the ``set`` command like so:: + + (Cmd) set allow_ansi Never + + +Removing A Builtin Command +-------------------------- + +[TODO] show how to remove a builtin command if you don't want it available to +your users. |