[issue14074] argparse allows nargs1 for positional arguments but doesn't allow metavar to be a tuple

2014-06-12 Thread Vasilis Vasaitis
Changes by Vasilis Vasaitis vvasai...@gmail.com: -- nosy: +vvas ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14074 ___ ___ Python-bugs-list

[issue14074] argparse allows nargs1 for positional arguments but doesn't allow metavar to be a tuple

2014-04-27 Thread paul j3
paul j3 added the comment: This patch fixes both help and error formatting. A module level '_format_metavars' does the formatting for both. I have tried several alternatives, including using the 'usage' style. There is similarity between this fix and that for issue 16468 (custom choices),

[issue14074] argparse allows nargs1 for positional arguments but doesn't allow metavar to be a tuple

2014-04-26 Thread paul j3
paul j3 added the comment: oops - to fix the error message that OP complained about, I need to patch '_get_action_name' as well: def _get_action_name(argument): ... elif argument.metavar not in (None, SUPPRESS): metavar = argument.metavar if

[issue14074] argparse allows nargs1 for positional arguments but doesn't allow metavar to be a tuple

2013-07-26 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: -- nosy: +paul.j3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14074 ___ ___ Python-bugs-list mailing list

[issue14074] argparse allows nargs1 for positional arguments but doesn't allow metavar to be a tuple

2013-07-26 Thread paul j3
paul j3 added the comment: This patch fixes the problem by joining the metavar terms with '|'. So the help for the test case (adapted from an existing tuple test) looks like: usage: PROG [-h] W1 [W2 ...] [X1 [X2 ...]] Y1 Y2 Y3 [Z1] positional arguments: W1|W2 w X1|X2

[issue14074] argparse allows nargs1 for positional arguments but doesn't allow metavar to be a tuple

2012-02-25 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: Looks like the problem is that _format_action_invocation is not being as careful with the different possibilities for metavar as _format_args is. Patches welcome! -- ___ Python tracker

[issue14074] argparse allows nargs1 for positional arguments but doesn't allow metavar to be a tuple

2012-02-24 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- title: argparse does not allow nargs1 for positional arguments but doesn't allow metavar to be a tuple - argparse allows nargs1 for positional arguments but doesn't allow metavar to be a tuple