[issue9182] document “--” as a way to distinguish option w/ narg='+' from positional argument in argparse

Daniel Albeseder <kotan@gmx.at> added the comment: Steven: From msg121850 I think the last two examples do not need the "--". Since there are no positional arguments, the "--" is not needed. However the following additional cases exist: -x X [X ...] -y Y -- A B # since optionals might come in other order Basically every of the three variable length classes need to be tested: ZeroOrOne, ZeroOrMore and OneOrMore. This might always come in a conflict with positional arguments needed afterward (even with optional positional arguments!). BTW - I recognized the following seem to be supported: for [-x [X ...]] -- [y ...] the following input: a -x -- b I would expect to be 'a' and 'b' positional arguments and the optional '-x' has no argument. However this seem not to work. Another issue or desired behavior? ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue9182> _______________________________________
participants (1)
-
Daniel Albeseder