ANNOUNCE: Optik 1.0 (new command-line parsing library)

Paul Jackson pj at sgi.com
Wed Nov 14 15:57:42 EST 2001


Greg wrote:
|> [me, on allowing interspersed options and args in Optik]
|> ...
|> OK, I think I'll add this feature.  Still haven't decided to
|> enable it by default, but I'm leaning that way right now -- it
|> improves usability and shouldn't ruin anyone's day, especially
|> since "--" can always be used for "stop processing options now".

Well, I for one would not like to see such.  It's just
a preference issue for me, so feel free to count votes and
declare a winner (or just imagine counting them, and cast the
final vote yourself ;).

But as an old Unix hacker, I'd not expect that arguments past
the first non-option arg would be scanned for further options
(with a few annoying exceptions ...).

Better to solve the problem of inserting an option after you've
already typed further in the line by using a shell that allows
more flexible command line editing.

Better not to encourage yet more gratuitous differences in the
non-essential details of how commands parse their command line.

Also, adding such a feature will result in the following sequence
of events, leading to frustration:
    1) Optik parses interspersed options by default
    2) Nice New Command is written using Optik
    3) User happens to invoke Nice New Command with interspersed
	options, not even aware that this is "special".
    4) Same user can't figure out why some other (not so blessed)
	command is misbehaving (they interspersed options).

And it can lead to yet another frustation:
    1) Directory contains (admittedly rare) instance of file
	whose name matches the pattern '-*'.
    2) User invokes Nice New Command using shell wild cards:
	nicenewfoo -a -b -c *
    3) Nice New Command behaves most unexpectedly

Like I said - one "no" vote here.
-- 

                          I won't rest till it's the best ...
                          Manager, Linux Scalability
                          Paul Jackson <pj at sgi.com> 1.650.933.1373



More information about the Python-list mailing list