Skip to content

Commit cf70502

Browse files
committed
Updated comment
1 parent a51f568 commit cf70502

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmd2/pyscript_bridge.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ def process_argument(action, value):
242242
command += ' {}'.format(item)
243243

244244
# If this is a flag parameter that can accept a variable number of arguments and we have not
245-
# reached the max number, add a list completion suffix to tell argparse to move to the next
246-
# parameter
245+
# reached the max number, add 2 prefix chars (ex: --) to tell argparse to stop processing the
246+
# parameter. This also means the remaining arguments will be treated as positionals by argparse.
247247
if action.option_strings and isinstance(action, _RangeAction) and action.nargs_max is not None and \
248248
action.nargs_max > len(value):
249249
command += ' {0}{0}'.format(self._parser.prefix_chars[0])
@@ -257,8 +257,8 @@ def process_argument(action, value):
257257
command += ' {}'.format(value)
258258

259259
# If this is a flag parameter that can accept a variable number of arguments and we have not
260-
# reached the max number, add a list completion suffix to tell argparse to move to the next
261-
# parameter
260+
# reached the max number, add 2 prefix chars (ex: --) to tell argparse to stop processing the
261+
# parameter. This also means the remaining arguments will be treated as positionals by argparse.
262262
if action.option_strings and isinstance(action, _RangeAction) and action.nargs_max is not None and \
263263
action.nargs_max > 1:
264264
command += ' {0}{0}'.format(self._parser.prefix_chars[0])

0 commit comments

Comments
 (0)