[getopt-sig] there isn't really any discussion here

Derek Harland derek@chocolate-fish.com
Wed, 13 Feb 2002 23:25:23 -0000


Sorry Russ ... i believe I've also managed to send this to you personally
twice by accident ... technology defeats me ...

----- Original Message -----
From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: <derek@chocolate-fish.com>; <getopt-sig@python.org>
Sent: Wednesday, February 13, 2002 9:21 PM
Subject: Re: [getopt-sig] there isn't really any discussion here

> That's not what I mean by ``optional arguments''.  What I mean is some
people
> want to define a flag -c that might or might not take an argument.
> In this case, it introduces an ambiguity.  If -c takes an optional
argument,
> does "foo -cd" mean "foo -c -d" or "foo -c d".  What if I want to specify
> -c without an argument but then have a normal command-line argument
> follow?  If you've got long options with their '--option=argument' syntax,
> there's no ambiguity to making the '=argument' not optional.

Aah I understand what you mean.  I agree, I really do not like this
possibility either, not just because of the parsing ambiguity.

> Then I don't see why it's not a command line argument.  Why not just
> define that the first thing on the command line after the options
> is the currency?  By your scheme, I would have to say
> "ssh --host=mycomputer" instead of "ssh mycomputer".
> I don't see the point of using option syntax when the option
> isn't really optional.

This is true, but only really when there is *one* such option.  What if it
needs a host name and a port (and it cant guess either, lets pretend ssh has
no standard port !) ?  Then using mandatory arguments they can go ssh -H
host -P port or ssh -P port -H host.  Without they *have* to go ssh host
port ... ie they *have* to know the predefined order before they execute the
script ... I like to enter arguments as they come to me (and i have  random
brain ;-)).

Ok this isnt a good example, every knows host comes before port but often
the arguments have little orderal relationship to each other.  Futher, it
lets you leave the remaining command line arguments for other more
traditional uses, such as a list of file names.

Des.