[getopt-sig] Separation of mechanics from semantics
Patrick Callahan
pac1@tiac.net
Thu, 14 Feb 2002 06:33:40 -0500
Re: [getopt-sig] there isn't really any discussion here
Then lets start some.
What is it people really are trying to do when they ask for the kind of
option parsing features that raise objections.
On Wednesday 13 February 2002 04:23, Greg Ward wrote:
<snip>
> option argument
> 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.
> ["-f", "foo"]
> may be equivalent to
> ["-ffoo"]
>
> 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.
>
What kinds of semantics do people want to represent by having an option with
an optional option argument. What would the difference be between
"-x "and "-x value"? When people talk about allowing options to have
optional arguments do they usually want to have the option without the
argument represent some default value or do they have some other use in mind?
> positional argument
> 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.)
>
> required option
> 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.
>
Why want them? What do people have in mind when they request this in an
option package? What kind of thinking is really behind the requests for this?
Why do they keep coming up?
I'm not seeking an answer to whether its a good or bad thing at this point,
just trying to find out more about how some of us think about the command
line and how it is actually being used.
-Pat