[Python-Dev] Python 2.7b1 and argparse's version action (original) (raw)

Ben Finney ben+python at benfinney.id.au
Mon Apr 19 04:38:21 CEST 2010


Tobias Herp <Tobias.Herp at gmx.de> writes:

Steven Bethard schrieb: > On Sun, Apr 18, 2010 at 3:52 PM, Antoine Pitrou <solipsis at pitrou.net> wrote: >> Steven Bethard <steven.bethard gmail.com> writes: >>> Note that even though I agree with you that "-v/--version" is >>> probably not the best choice, in the poll[2] 11% of people still >>> wanted this. >> >> This strikes me as a small minority. > > Agreed, but it's also the current behavior, ...

The current /broken, non-standard/ behaviour.

I think that is overstating your case.

Steven is pointing out the fact that “default to ‘-v’ and ‘--version’” is the current behaviour for argparse. It's also a fact that argparse, as a third-party library, has an existing user base, and changing this behaviour incompatibly is not something to do lightly.

To call this behaviour “broken” is a stretch too far, IMO. It does break compatibility with optparse, but it's not inherently broken as the above would imply.

Nor is there really a standard for this behaviour to be measured “non-standard”. At best, there is a strong convention among Unix command-line programs of ‘--version’ for a version action and ‘-v’ for enabling verbose output. But that convention is not normative, so it's too much to call it a standard IMO.

I have collected lots of examples of widely used programs and their options. The only example of '-v', '--verbose' is argparse.

I'm not sure what programs you're talking about (argparse is a library, not a program that can be run by itself), but in a brief search of my system I've found several programs that use ‘-v’ for a version action, including among others:

These are certainly widely deployed, although they may not be widely familiar.

I do agree that such programs are a small minority, but it's overstating your case to call them “non-standard”, since there's no standard for this, or “broken”, since they demonstrably work fine. Rather, they buck what is certainly a firm convention to avoid ‘-v’ for a version option.

I'm certainly in favour of preserving that convention by avoiding use of ‘-v’ for version. I would rather, though, that the discussion remain aware of facts and not descend into hyperbole.

-- \ “Perchance you who pronounce my sentence are in greater fear | `\ than I who receive it.” —Giordano Bruno, burned at the stake by | o_) the Catholic church for the heresy of heliocentrism, 1600-02-16 | Ben Finney



More information about the Python-Dev mailing list