
Caleb Epstein wrote:
On Wed, 24 Nov 2004 10:27:59 +0300, Vladimir Prus <ghost@cs.msu.su> wrote:
Ok, let me start with a caveat: ignoring unknown options can be ambiguous:
program --something 10 --known_option
Now, is "10" a value of unknown option or positional option? To remove the problems all unknown options must use this form:
--something=10
which may be problem, or may not, depending on your situation. What do you think?
I think it is unreasonable to expect all command lines to be specified in this way. If --something expects an argument, then 10 is that argument.
Well, I obvious don't know if an unknown option expects an argument ;-)
If --something is a flag then its either an unknown argument or (if you allow argument vector rearranging ala GNU getopt) it is the first positional parameter.
While it's possible to consider all unknown options to be positional options, this still leaves the question what to do with "10". Should it be passed to the application as position option?
Allowing unknown options to be ignored is a very desirable feature, though it should be disabled by default.
I just don't see any solution to make unknown options work without either -- requiring --something=10 format -- requiring that all positional options are at the end - Volodya