@@ -12,8 +12,8 @@ command. The `help` command by itself displays a list of the commands available:
12
12
``` text
13
13
(Cmd) help
14
14
15
- Documented commands (use 'help -v' for verbose/'help <topic>' for details):
16
- ===========================================================================
15
+ Documented Commands
16
+ ───────────────────
17
17
alias help ipy py run_pyscript set shortcuts
18
18
edit history macro quit run_script shell
19
19
```
@@ -24,9 +24,9 @@ The `help` command can also be used to provide detailed help for a specific comm
24
24
(Cmd) help quit
25
25
Usage: quit [-h]
26
26
27
- Exit this application
27
+ Exit this application.
28
28
29
- optional arguments :
29
+ Optional Arguments :
30
30
-h, --help show this help message and exit
31
31
```
32
32
@@ -37,8 +37,9 @@ help for a command is the docstring for the `do_*` method defining the command -
37
37
** foo** , that command is implemented by defining the ` do_foo ` method and the docstring for that
38
38
method is the help.
39
39
40
- For commands which use one of the ` argparse ` decorators to parse arguments, help is provided by
41
- ` argparse ` . See [ Help Messages] ( ./argument_processing.md#help-messages ) for more information.
40
+ For commands which use the [ @with_argparser] [ cmd2.with_argparser ] decorator to parse arguments, help
41
+ is provided by ` argparse ` . See [ Help Messages] ( ./argument_processing.md#help-messages ) for more
42
+ information.
42
43
43
44
Occasionally there might be an unusual circumstance where providing static help text isn't good
44
45
enough and you want to provide dynamic information in the help text for a command. To meet this
@@ -51,42 +52,41 @@ not use an `argparse` decorator because we didn't want different output for `hel
51
52
52
53
By default, the ` help ` command displays:
53
54
54
- Documented commands (use 'help -v' for verbose/'help <topic>' for details):
55
- ===========================================================================
55
+ Documented Commands
56
+ ───────────────────
56
57
alias help ipy py run_pyscript set shortcuts
57
58
edit history macro quit run_script shell
58
59
59
60
If you have a large number of commands, you can optionally group your commands into categories.
60
- Here's the output from the example ` help_categories.py ` :
61
-
62
- Documented commands (use 'help -v' for verbose/'help <topic>' for details):
61
+ Here's the output from the example
62
+ [ help_categories.py] ( https://github.com/python-cmd2/cmd2/blob/main/examples/help_categories.py ) :
63
63
64
64
Application Management
65
- ======================
65
+ ──────────────────────
66
66
deploy findleakers redeploy sessions stop
67
67
expire list restart start undeploy
68
68
69
69
Command Management
70
- ==================
70
+ ──────────────────
71
71
disable_commands enable_commands
72
72
73
73
Connecting
74
- ==========
74
+ ──────────
75
75
connect which
76
76
77
77
Server Information
78
- ==================
78
+ ──────────────────
79
79
resources serverinfo sslconnectorciphers status thread_dump vminfo
80
80
81
81
Other
82
- =====
83
- alias edit history py run_pyscript set shortcuts
84
- config help macro quit run_script shell version
82
+ ─────
83
+ alias edit history quit run_script shell version
84
+ config help macro run_pyscript set shortcuts
85
85
86
- There are 2 methods of specifying command categories, using the ` @with_category ` decorator or with
87
- the ` categorize() ` function. Once a single command category is detected, the help output switches to
88
- a categorized mode of display. All commands without an explicit category defined default to the
89
- category ` Other ` .
86
+ There are 2 methods of specifying command categories, using the [ @with_category] [ cmd2.with_category ]
87
+ decorator or with the [ categorize()] [ cmd2.categorize ] function. Once a single command category is
88
+ detected, the help output switches to a categorized mode of display. All commands without an
89
+ explicit category defined default to the category ` Other ` .
90
90
91
91
Using the ` @with_category ` decorator:
92
92
@@ -134,58 +134,70 @@ categorize((do_undeploy,
134
134
The ` help ` command also has a verbose option (` help -v ` or ` help --verbose ` ) that combines the help
135
135
categories with per-command help messages:
136
136
137
- Documented commands (use 'help -v' for verbose/'help <topic>' for details):
138
-
139
137
Application Management
140
- ======================================================================================================
141
- deploy Deploy command.
142
- expire Expire command.
143
- findleakers Find Leakers command.
144
- list List command.
145
- redeploy Redeploy command.
146
- restart Restart command.
147
- sessions Sessions command.
148
- start Start command.
149
- stop Stop command.
150
- undeploy Undeploy command.
138
+ ─────────────────────────────────────
139
+ Name Description
140
+ ─────────────────────────────────────
141
+ deploy Deploy command.
142
+ expire Expire command.
143
+ findleakers Find Leakers command.
144
+ list List command.
145
+ redeploy Redeploy command.
146
+ restart Restart command.
147
+ sessions Sessions command.
148
+ start Start command.
149
+ stop Stop command.
150
+ undeploy Undeploy command.
151
+
151
152
152
153
Command Management
153
- ======================================================================================================
154
- disable_commands Disable the Application Management commands.
155
- enable_commands Enable the Application Management commands.
154
+ ─────────────────────────────────────────────────────────────────
155
+ Name Description
156
+ ─────────────────────────────────────────────────────────────────
157
+ disable_commands Disable the Application Management commands.
158
+ enable_commands Enable the Application Management commands.
159
+
156
160
157
161
Connecting
158
- ======================================================================================================
159
- connect Connect command.
160
- which Which command.
162
+ ────────────────────────────
163
+ Name Description
164
+ ────────────────────────────
165
+ connect Connect command.
166
+ which Which command.
167
+
161
168
162
169
Server Information
163
- ======================================================================================================
170
+ ─────────────────────────────────────────────────────────────────────────────────────────────────
171
+ Name Description
172
+ ─────────────────────────────────────────────────────────────────────────────────────────────────
164
173
resources Resources command.
165
174
serverinfo Server Info command.
166
175
sslconnectorciphers SSL Connector Ciphers command is an example of a command that contains
167
- multiple lines of help information for the user. Each line of help in a
168
- contiguous set of lines will be printed and aligned in the verbose output
169
- provided with 'help --verbose'.
176
+ multiple lines of help information for the user. Each line of help in a
177
+ contiguous set of lines will be printed and aligned in the verbose output
178
+ provided with 'help --verbose'.
170
179
status Status command.
171
180
thread_dump Thread Dump command.
172
181
vminfo VM Info command.
173
182
183
+
174
184
Other
175
- ======================================================================================================
176
- alias Manage aliases.
177
- config Config command.
178
- edit Run a text editor and optionally open a file with it.
179
- help List available commands or provide detailed help for a specific command.
180
- history View, run, edit, save, or clear previously entered commands.
181
- macro Manage macros.
182
- quit Exit this application.
183
- run_pyscript Run Python script within this application's environment.
184
- run_script Run text script.
185
- set Set a settable parameter or show current settings of parameters.
186
- shell Execute a command as if at the OS prompt.
187
- shortcuts List available shortcuts.
188
- version Version command.
185
+ ─────────────────────────────────────────────────────────────────────────────────────────
186
+ Name Description
187
+ ─────────────────────────────────────────────────────────────────────────────────────────
188
+ alias Manage aliases.
189
+ config Config command.
190
+ edit Run a text editor and optionally open a file with it.
191
+ help List available commands or provide detailed help for a specific command.
192
+ history View, run, edit, save, or clear previously entered commands.
193
+ macro Manage macros.
194
+ quit Exit this application.
195
+ run_pyscript Run Python script within this application's environment.
196
+ run_script Run text script.
197
+ set Set a settable parameter or show current settings of parameters.
198
+ shell Execute a command as if at the OS prompt.
199
+ shortcuts List available shortcuts.
200
+ version Version command.
189
201
190
202
When called with the ` -v ` flag for verbose help, the one-line description for each command is
191
203
provided by the first line of the docstring for that command's associated ` do_* ` method.
0 commit comments