Skip to content

Commit 8c0dc69

Browse files
authored
Merge pull request #856 from python-cmd2/builtin_command_docs
Flushed out documentation on built-in commands
2 parents 9969f72 + 918ff1a commit 8c0dc69

File tree

1 file changed

+73
-3
lines changed

1 file changed

+73
-3
lines changed

docs/features/builtin_commands.rst

Lines changed: 73 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,18 @@ which may be useful to your users. Developers can
66
:ref:`features/builtin_commands:Remove Builtin Commands` if they do not want
77
them to be part of the application.
88

9+
List of Builtin Commands
10+
------------------------
11+
12+
alias
13+
~~~~~
14+
15+
This command manages aliases via subcommands ``create``, ``delete``, and
16+
``list``. See :ref:`features/shortcuts_aliases_macros:Aliases` for more
17+
information.
18+
919
edit
10-
----
20+
~~~~
1121

1222
This command launches an editor program and instructs it to open the given file
1323
name. Here's an example:
@@ -19,9 +29,62 @@ name. Here's an example:
1929
The program to be launched is determined by the value of the
2030
:ref:`features/settings:editor` setting.
2131

32+
help
33+
~~~~
34+
35+
This command lists available commands or provides detailed help for a specific
36+
command. When called with the ``-v/--verbose`` argument, it shows a brief
37+
description of each command. See :ref:`features/help:Help` for more
38+
information.
39+
40+
history
41+
~~~~~~~
42+
43+
This command allows you to view, run, edit, save, or clear previously entered
44+
commands from the history. See :ref:`features/history:History` for more
45+
information.
46+
47+
ipy
48+
~~~
49+
50+
This optional opt-in command enters an interactive IPython shell. See
51+
:ref:`features/embedded_python_shells:IPython (optional)` for more information.
52+
53+
macro
54+
~~~~~
55+
56+
This command manages macros via subcommands ``create``, ``delete``, and
57+
``list``. A macro is similar to an alias, but it can contain argument
58+
placeholders. See :ref:`features/shortcuts_aliases_macros:Macros` for more
59+
information.
60+
61+
py
62+
~~
63+
64+
This command invokes a Python command or shell. See
65+
:ref:`features/embedded_python_shells:Embedded Python Shells` for more
66+
information.
67+
68+
quit
69+
~~~~
70+
71+
This command exits the ``cmd2`` application.
72+
73+
run_pyscript
74+
~~~~~~~~~~~~
75+
76+
This command runs a Python script file inside the ``cmd2`` application.
77+
See :ref:`features/scripting:Python Scripts` for more information.
78+
79+
run_script
80+
~~~~~~~~~~
81+
82+
This command runs commands in a script file that is encoded as either ASCII
83+
or UTF-8 text. See :ref:`features/scripting:Command Scripts` for more
84+
information.
2285

2386
set
24-
---
87+
~~~
2588

2689
A list of all user-settable parameters, with brief comments, is viewable from
2790
within a running application:
@@ -48,9 +111,10 @@ the ``set`` command like so:
48111
49112
(Cmd) set allow_style Never
50113
114+
See :ref:`features/settings:Settings` for more information.
51115

52116
shell
53-
-----
117+
~~~~~
54118

55119
Execute a command as if at the operating system shell prompt:
56120

@@ -59,6 +123,12 @@ Execute a command as if at the operating system shell prompt:
59123
(Cmd) shell pwd -P
60124
/usr/local/bin
61125
126+
shortcuts
127+
~~~~~~~~~
128+
129+
This command lists available shortcuts. See
130+
:ref:`features/shortcuts_aliases_macros:Shortcuts` for more information.
131+
62132

63133
Remove Builtin Commands
64134
-----------------------

0 commit comments

Comments
 (0)