File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -227,8 +227,8 @@ class CmdLineApp(cmd2.Cmd):
227
227
228
228
## Unknown Positional Arguments
229
229
230
- To pass all unknown arguments to be passed to your command as a list of strings, then decorate the
231
- command method with the ` @with_argparser(..., with_unknown_args=True) ` decorator.
230
+ To pass all unknown arguments to your command as a list of strings, then decorate the command method
231
+ with the ` @with_argparser(..., with_unknown_args=True) ` decorator.
232
232
233
233
Here's what it looks like:
234
234
Original file line number Diff line number Diff line change @@ -73,34 +73,34 @@ already parsed.
73
73
74
74
A ` Statement ` object is a subclass of ` str ` that contains the following attributes:
75
75
76
- command
76
+ ** command**
77
77
78
78
: Name of the command called. You already know this because of the method ` cmd2 ` called, but it can
79
79
sometimes be nice to have it in a string, i.e. if you want your error messages to contain the
80
80
command name.
81
81
82
- args
82
+ ** args**
83
83
84
84
: A string containing the arguments to the command with output redirection or piping to shell
85
85
commands removed. It turns out that the "string" value of the ` Statement ` object has all the output
86
86
redirection and piping clauses removed as well. Quotes remain in the string.
87
87
88
- command_and_args
88
+ ** command_and_args**
89
89
90
90
: A string of just the command and the arguments, with output redirection or piping to shell
91
91
commands removed.
92
92
93
- argv
93
+ ** argv**
94
94
95
95
: A list of arguments a-la ` sys.argv ` , including the command as ` argv[0] ` and the subsequent
96
96
arguments as additional items in the list. Quotes around arguments will be stripped as will any
97
97
output redirection or piping portions of the command.
98
98
99
- raw
99
+ ** raw**
100
100
101
101
: Full input exactly as typed by the user.
102
102
103
- terminator
103
+ ** terminator**
104
104
105
105
: Character used to end a multiline command. You can configure multiple termination characters, and
106
106
this attribute will tell you which one the user typed.
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ an error occurs in which it is more desirable to display a message than a stack
84
84
has a member called ` apply_style ` . Set this False if the error style should not be applied. For
85
85
instance, ` ArgparseCompleter ` sets it to False when displaying completion hints.
86
86
87
- ## Tab Completion Using argparse Decorator {: #argparse-based }
87
+ ## Tab Completion Using the argparse Decorator {: #argparse-based }
88
88
89
89
When using ` cmd2 ` 's [ @with_argparser] [ cmd2.with_argparser ] decorator, ` cmd2 ` provides automatic tab
90
90
completion of flag names.
You can’t perform that action at this time.
0 commit comments