From cf70502c48a779a8102e4e0fc5cca2051b2125fc Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Fri, 30 Nov 2018 14:02:23 -0500 Subject: Updated comment --- cmd2/pyscript_bridge.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmd2/pyscript_bridge.py') 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]) -- cgit v1.2.1