diff options
Diffstat (limited to 'cmd2')
| -rw-r--r-- | cmd2/argparse_completer.py | 2 | ||||
| -rw-r--r-- | cmd2/cmd2.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/cmd2/argparse_completer.py b/cmd2/argparse_completer.py index d74226fa..39e9607b 100644 --- a/cmd2/argparse_completer.py +++ b/cmd2/argparse_completer.py @@ -191,7 +191,7 @@ class ArgparseCompleter: :param line: the current input line with leading whitespace removed :param begidx: the beginning index of the prefix text :param endidx: the ending index of the prefix text - :param tokens: list of argument tokens to parse + :param tokens: list of argument tokens being passed to the parser :param cmd_set: if tab completing a command, the CommandSet the command's function belongs to, if applicable. Defaults to None. diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index c6dbef06..701684c2 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -2555,7 +2555,11 @@ class Cmd(cmd.Cmd): CompletionMode.NONE. The following optional settings apply when completion_mode is CompletionMode.CUSTOM. - :param preserve_quotes: + :param preserve_quotes: if True, then quoted tokens will keep their quotes when processed by + ArgparseCompleter. This is helpful in cases when you're tab completing + flag-like tokens (e.g. -o, --option) and you don't want them to be + treated as argparse flags when quoted. Set this to True if you plan + on passing the string to argparse with the tokens still quoted. A maximum of one of these should be provided: |
