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

Jp Calderone kuran42 at
Thu Nov 15 20:39:28 CET 2001

   Ahhh, but - sorts before most other characters.  Any files matching -*
will probably show up first when * is expanded, and the problem remains.
Just one of the reasons I prefer to parse all - and -- options up until
a -- is found.  Who knows what you'll get after wildcards are expanded.
Best to explicitly terminate option parsing.

Paul Jackson wrote:

> 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.

Seduced, shaggy Samson snored.
She scissored short.  Sorely shorn,
Soon shackled slave, Samson sighed,
Silently scheming,
Sightlessly seeking
Some savage, spectacular suicide.
                 -- Stanislaw Lem, "Cyberiad"
  2:33pm up 12 days, 16:52, 2 users, load average: 0.19, 0.12, 0.09

More information about the Python-list mailing list