Steven Bethard wrote: > On Sun, Apr 18, 2010 at 3:57 PM, Nick Coghlan <ncogh...@gmail.com> wrote: >> 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>') >> With that change, I would have no problem with the current argparse >> behaviour (since doing it this way makes it very easy for people to add >> a "-V" shortcut if they want one). > > Probably this should happen regardless of the outcome of the > constructor argument. The only reason it wasn't already there is that > I hadn't thought of it. ;-)
Crazy thought... would it make sense to have the following implicitly use "--version" as the option flag: parser.add_argument(action='version', version='<details>') There are two things about the explicit '--version' that bother me: 1. It reduces the automatic provision of "standard" option spellings 2. The repetition in reading/writing 'version' 3 times is kind of annoying (Probably a bad idea, since adding "-V" would mean having to add "--version" as well, but figured it was worth mentioning). Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia --------------------------------------------------------------- _______________________________________________ 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