"Martin v. Löwis" schrieb: >> - 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). > > You actually brought up a good reason yourself: > > In the face of ambiguity, refuse the temptation to guess.
I didn't guess. The vast majority of *x commandline tools, *including the Python interpreter*, uses '--version' and/or '-V' for the version action, while '-v' is often used for something else, most often verbosity (again: e.g. the Python interpreter). Nobody has argued the converse. The optparse module uses just '--version' option string by default, following the standard. > If you ask "give me a version argument", the question is "how is it > spelled?". IIUC, you originally complained that the spelling of argparse > (i.e. -v/--version) is not good, and that a different spelling should be > used. So it's ambiguous, in which case the feature shouldn't be provided > in the first place. Wrong! Just follow the de-facto standard. There has never been a problem with optparse's version argument, simply because of the fact it conforms with the standard (using just '--version'). Perhaps we wouldn't argue now if they had decided to add '-V' as well, which is AFAIK /never/ used for anything else than the version, either; perhaps this would have been adopted by argparse as well. The optik/optparse people didn't, and the argparse people apparently didn't really look out what options look like in the wild. There is *no* problem with a 'version' argument (which has always been *optional*; nobody is forced to use it) which simply defines the '--version' option to trigger the version option. There has *never* been a problem with the optparse way to do it! Now argparse wants to become a part of Python's standard library; it certainly has advantages over optparse. But the user won't be interested in the difference: "Oh, I see, this is an argparse-based program, so the '-v' is naturally not available for verbosity. Fine!" Up to today, the argparse module had a limited audience. When becoming part of Python, it must follow standards; it should Do The Right Thing by default, and it should keep the usage difference to optparse as small as possible. People should be allowed to rely on the fact that /Python scripts follow the standards/; this is a huge usability gain. Thus, argparse should *continue* to support the version argument, because it is convenient (we use Python because it is convenient!), and it is sufficient in 95% of the cases (I have written lots of optparse scripts, and in exactly one case I wrote the version output myself). It should discontinue the '-v' short option string, because it is non-standard, and it is ambiguous; it is often used for something else, while '-V' isn't (but adding this as a default would like break existing argparse programs, so this is not an option). If the community feels this is necessary, the '-v' could be supported 'invisibly': it should not be visible in the help, and it must not block the usage of '-v' for other purposes. -- 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