A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/1999-October/001051.html below:

[Python-Dev] getopt helper?

[Python-Dev] getopt helper?Mark Hammond mhammond@skippinet.com.au
Sun, 3 Oct 1999 17:52:59 +1000
Greg writes:
> I still think it would be very desirable to tie the short and long
> options together.  Eg.
>
>   options = [('verbose', 'v'),
>              ('quiet', 'q'),
>              ('thingy', None),
>              (None, 'x')
>              ('output=', 'o:')]
>   opts, args = getopt_or_die (options, usage, ...)
>

Im not convinced this is worth it.  I only use "long options" when I
have too many, or a few obscure ones.  I have never have "-v"
synonymous for "--verbose" - why bother?  I know I would never type
the later:-)

The existing mechanism still handles this quite well - the standard
"if opt==blah:" simply becomes "if opt in [...]:" - no real drag.

Plus its less change for reasonable reward - handy enough I may
actually add command-line handling as I create each little test/util
script :-)

What say anyone else?  Go with my "little change", Gregs "only
slightly more change" or "don't worry about it"?

Mark.




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4