summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-09-01 18:12:59 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-09-01 18:12:59 -0400
commitbf3d1e4132a04dd0983dd0bddc2889454b6a3048 (patch)
tree8352d9ae8d4872a5c62cfce0f0bc1502a7fe1a36
parent7294ebcfdc01364da0c7b259e3985dff36bb4864 (diff)
downloadcmd2-git-bf3d1e4132a04dd0983dd0bddc2889454b6a3048.tar.gz
Updated comments
-rw-r--r--cmd2/argparse_completer.py2
-rw-r--r--cmd2/cmd2.py6
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: