[Python-Dev] Python 2.7b1 and argparse's version action (original) (raw)
Tobias Herp Tobias.Herp at gmx.de
Mon Apr 19 02:07:35 CEST 2010
- Previous message: [Python-Dev] Python 2.7b1 and argparse's version action
- Next message: [Python-Dev] Python 2.7b1 and argparse's version action
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Eric Smith schrieb:
Steven Bethard wrote:
By the way, we could simplify the typical addargument usage by adding "show program's version number and exit" as the default help for the 'version' action. Then you should just write:
parser.addargument('--version', action='version', version='') I like this the best. I don't like argparse adding arguments for me.
There is no reason why you shouldn't get it. You could always (and with optparse as well as argparse) omit the version argument and build or build not the version argument yourself.
Or a special add_version_option (hey, it's really an /option/) or add_version_argument method, which would work without if statements and could be overridden in subclasses.
But note that
- many optparse programs use the version argument
- many other programmers find this feature very convenient
- dropping or deprecating this is a totally unnecessary change (I have not read a single real reason /why/ this should be done).
-- Tobias
- Previous message: [Python-Dev] Python 2.7b1 and argparse's version action
- Next message: [Python-Dev] Python 2.7b1 and argparse's version action
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]