Eric Smith schrieb: > Steven Bethard wrote: >> By the way, we could simplify the typical add_argument usage by adding >> "show program's version number and exit" as the default help for the >> 'version' action. Then you should just write: >> >> parser.add_argument('--version', action='version', version='<the >> 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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com