paul j3 <ajipa...@gmail.com> added the comment:
Sometimes patches have unforeseen benefits. My earlier patch for this issue, parse_intermixed_args, has been useful beyond the OP's case. https://stackoverflow.com/questions/50916124/allow-positional-command-line-arguments-with-nargs-to-be-seperated-by-a-flag https://bugs.python.org/issue15112 argparse: nargs='*' positional argument doesn't accept any items if preceded by an option and another positional With usage: test.py [-h] [-a A] b [c] and test.py B -a A C has problems because the optional '[c]' positional is used up when 'b' is processed. Intermixed gets around this by first processing '-a', and then handling 'b [c]' together. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42973> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com