getopt: where's da dicts?????
Fred L. Drake, Jr.
fdrake at acm.org
Wed Oct 20 13:43:20 EDT 1999
Fred L. Drake, Jr. <fdrake at acm.org> wrote:
> Since the current behavior of getopt is to allow both, I'd be
> inclined to keep it that way. There are lots of applications that
> already allow both (Python & otherwise; I don't think it's original
> behavior with getopt), I'm inclined to allow both rather than just
> one, and wouldn't want optional arguments to screw that up.
D'Arcy J.M. Cain writes:
> It is possible to add optional arguments without messing up regular
> use. You just have to put restrictions on the use of flags that
> take optional arguments but that's fine in an extension anyway. See
Perhaps it's not enough of a problem; I'm thinking of the case where
the applications command-line UI is "extended" by making a required
value optional. What was once:
myprog -f value
would no longer work if the value for -f became optional and required
a syntax change. Humans can (sometimes) be re-trained to type things
the new way. Getting humans to grep through hundreds of scripts that
may contain the offending syntax is harder. ;) (Hint: "grep
'myprog.*-f' *.sh" isn't even close to good enough!)
Breakage is evil, don't make it too easy!
-Fred
--
Fred L. Drake, Jr. <fdrake at acm.org>
Corporation for National Research Initiatives
More information about the Python-list
mailing list