[getopt-sig] The bake-off
Guido van Rossum
guido@python.org
Wed, 29 May 2002 23:42:03 -0400
This SIG is supposed to come up with a recommendation. Having an
option parsing library is one of the goals for Python 2.3 (I just
added this to PEP 283 :-).
I read Greg's bake-off. (http://www.python.org/sigs/getopt-sig/compare.html)
I didn't read the mailing list archives. Has there been more
discussion of the bake-off? The bake-off mostly convinced me that
Optik is the way to go for the standard library. I have an idea for a
second-order bake-off though.
Greg writes:
One weakness of Ripoff's command-line interface is that several
flag options don't have a negative counterpart: eg. there is a
--keep-tmp option, but no --no-keep-tmp. That sort of thing really
is necessary in the real world, where a program's default
(no-keep-tmp in this case) might be overridden by a config file,
and then overridden again on the command-line. This weakness is
currently reflected in all three of my test re-implementations.
As an exercice in how easy each of the three alternatives makes it to
change the option set, I'd like to see each version augmented with
this feature. There may be no config file yet, so maybe the default
values will have to be specified in a different way, like as globals.
The code to add that shouldn't be measured for the comparison below.
Then it would be useful to see how large the new version is (with and
without the help text) and how many lines had to be changed. If the
three contestants come out in the same order as in the first contest,
that settles the matter for me. If not, we'll have to try to
understand why.
--Guido van Rossum (home page: http://www.python.org/~guido/)