diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-11-30 14:02:23 -0500 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-11-30 14:02:23 -0500 |
commit | cf70502c48a779a8102e4e0fc5cca2051b2125fc (patch) | |
tree | c333a92df93e50a92587b3da7f8717ae2c1b1952 /cmd2/pyscript_bridge.py | |
parent | a51f568a748cfc3023337aa91b67cda274ba5882 (diff) | |
download | cmd2-git-cf70502c48a779a8102e4e0fc5cca2051b2125fc.tar.gz |
Updated comment
Diffstat (limited to 'cmd2/pyscript_bridge.py')
-rw-r--r-- | cmd2/pyscript_bridge.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd2/pyscript_bridge.py b/cmd2/pyscript_bridge.py index 7551ed88..402dfeac 100644 --- a/cmd2/pyscript_bridge.py +++ b/cmd2/pyscript_bridge.py @@ -242,8 +242,8 @@ class ArgparseFunctor: command += ' {}'.format(item) # If this is a flag parameter that can accept a variable number of arguments and we have not - # reached the max number, add a list completion suffix to tell argparse to move to the next - # parameter + # reached the max number, add 2 prefix chars (ex: --) to tell argparse to stop processing the + # parameter. This also means the remaining arguments will be treated as positionals by argparse. if action.option_strings and isinstance(action, _RangeAction) and action.nargs_max is not None and \ action.nargs_max > len(value): command += ' {0}{0}'.format(self._parser.prefix_chars[0]) @@ -257,8 +257,8 @@ class ArgparseFunctor: command += ' {}'.format(value) # If this is a flag parameter that can accept a variable number of arguments and we have not - # reached the max number, add a list completion suffix to tell argparse to move to the next - # parameter + # reached the max number, add 2 prefix chars (ex: --) to tell argparse to stop processing the + # parameter. This also means the remaining arguments will be treated as positionals by argparse. if action.option_strings and isinstance(action, _RangeAction) and action.nargs_max is not None and \ action.nargs_max > 1: command += ' {0}{0}'.format(self._parser.prefix_chars[0]) |