[issue4256] optparse/argparse: provide a simple way to get a programmatically useful list of options

Steven Bethard report at bugs.python.org
Wed Apr 21 21:38:16 CEST 2010


Steven Bethard <steven.bethard at gmail.com> added the comment:

2010/4/21 Filip Gruszczyński <report at bugs.python.org>:
> I don't really understand, why can't we just check if
> help-options is provided by the user and add our own,
> if it is not?

I'm sure it would be possible to do it this way. The question is
whether it makes sense to from the perspectives of code
maintainability and explaining awkward corner cases to users.

On Wed, Apr 21, 2010 at 12:29 PM, R. David Murray wrote:
> I don't see why --help-options would need to be listed in help.

Right. For argparse, suppressing the printing of --help-options in the
help message is as simple as setting help=SUPPRESS.

>  We could pick a more obscure name, too.

I think this is probably the best way forward. What is the format
that's being printed out? Is this a standard somewhere? Can we name
the flag something like "--print-parser-options-in-XXX-format"?

Steve

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4256>
_______________________________________


More information about the Python-bugs-list mailing list