[issue11708] argparse: suggestion for formatting optional positional args

2021-12-10 Thread Irit Katriel
Change by Irit Katriel : -- type: -> enhancement versions: +Python 3.11 -Python 2.7, Python 3.2, Python 3.3 ___ Python tracker ___

[issue11708] argparse: suggestion for formatting optional positional args

2014-04-24 Thread paul j3
paul j3 added the comment: This patch adds a ReGroupHelpFormatter class, which regroups positional arguments in the usage line as discussed before. It builds on the reworked usage formatter in bugs/python.org/issue11874 (which keeps usage as a list longer). For a complicate parser, usage

[issue11708] argparse: suggestion for formatting optional positional args

2014-04-24 Thread paul j3
paul j3 added the comment: This is a testing script for this patch. It is not a unit test. Example: p = argparse.ArgumentParser() p.formatter_class = argparse.ReGroupHelpFormatter p.add_argument('foo') p.add_argument('arg1',nargs='?') p.add_argument('arg2',nargs='?') a

[issue11708] argparse: suggestion for formatting optional positional args

2013-09-18 Thread paul j3
paul j3 added the comment: This is a HelpFormatter function that takes a list of formatted actions, and groups contiguous blocks of optional positional actions. It accounts for optionals (via prefix_chars) and mutually exclusive groups. Since it assumes 'parts' is a list, rather than string,

[issue11708] argparse: suggestion for formatting optional positional args

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

[issue11708] argparse: suggestion for formatting optional positional args

2011-12-15 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: I agree that this is a bug in current argparse formatting. It might be a little difficult to fix though because the current option formatting handles arguments one at a time, and producing something like [arg1 [arg2]] requires some

[issue11708] argparse: suggestion for formatting optional positional args

2011-07-24 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: I think this is a good idea, and seems to me more like a bug than a feature request. -- stage: - needs patch type: feature request - versions: +Python 3.2, Python 3.3 ___ Python tracker

[issue11708] argparse: suggestion for formatting optional positional args

2011-06-21 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11708 ___ ___ Python-bugs-list

[issue11708] argparse: suggestion for formatting optional positional args

2011-06-21 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- nosy: +bethard ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11708 ___ ___ Python-bugs-list mailing

[issue11708] argparse: suggestion for formatting optional positional args

2011-03-28 Thread Peter Williams
New submission from Peter Williams pwil3...@bigpond.net.au: At present, if a number (e.g. 2) of optional positional arguments are defined (e.g. arg1 and arg2) argparse formats them as follows: usage: program [arg1] [arg2] in the usage message. I would like to suggest that a better format