[getopt-sig] there isn't really any discussion here
Wed, 13 Feb 2002 16:23:46 -0500
On 13 February 2002, Derek Harland said:
> I'm not sure I understand either of these worries. To me an optional
> argument is usually a simple flag to the program to indicate something. I
> mean you either compile a c program in debug mode, or you don't.
> Alternatively its something you specify if required, otherwise the program
> decides it for you.
Let's get some terminology straight. Howl if you think these
definitions are bogus:
something in sys.argv (or possibly sys.argv[1:], depending on
an argument used to supply extra information to guide or
customize the execution of a program. In Unix, options usually
start with "-" or "--"; in DOS/VMS with "/".
an argument that follows an option and which is closely associated
with that option, and consumed from the argument list when the
option is. Often, option arguments may also be included in the same
argument as the option, eg.
may be equivalent to
Some options never take an argument. Some options always take an
argument. Lots of people want an "optional option arguments"
feature, meaning that some options will take an argument if they see
it, and won't if they don't. This is somewhat controversial.
something leftover in sys.argv after options have been parsed, ie.
options and option arguments removed from the argument list.
(Note that Optik does not change sys.argv, but returns a copy of
it with only positional args left. Other getopt replacements
might work like this, or they might not.)
an option that must be supplied on the command-line; this is
an oxymoron and I personally consider it poor UI design.
(I gather Russ Cox agrees with me.) Any getopt replacement should
make it fairly easy to implement required options, though, because
lots of people want them.
Greg Ward - nerd email@example.com
There's nothing to see here. Move on; go about your business.