[getopt-sig] Comparing option libraries
A.T. Hofkamp
a.t.hofkamp@tue.nl
Tue, 26 Feb 2002 14:26:33 +0100 (CET)
On Tue, 26 Feb 2002, Matthias Urlichs wrote:
> The same story happens with --quiet/--verbose. If somebody specifies "-q
> -vv" then that should be an error. However, if the configuration file says
> "-v" and the command line "-q", that's OK.
I agree. The program may 'find' option settings from various places, and
combine them in a well-defined and (preferably) sensible way.
Usually, there is a precedence relation between option settings from different
sources, which is fine as far as I can see.
This does raise the question of other places where options can be found.
- Should the standard package be able to deal with them ?
- Should we use the same syntax, or would a different syntax be allowed ?
- Is a precedence relation ok ?
- How do the various toolkits handle option settings from different sources ?
(argtools does not currently, at least not in a nice way).
Plenty of questions I think.... :-)
> Configuration files, however, are NOT command line options. A config file
> should not be forced to look like a command line just so that the command
> line parser is happy.
We are on sliding ground here I think. We are very much moving towards a
full-featured command line package that understands any syntax we come up with.
<broad smile>
I knew we would end up with a scanner and parser for our option processing.
</broad smile>
>
> > Very rough, untested implementation:
> >
> Looks sensible, except for the typo: ;-)
> > return _NOMATH
Just a test whether people are reading the code :-)
Tnx for the comment,
Albert
--
Constructing a computer program is like writing a painting