driscoll@cs.wisc.edu writes:
Olaf Meeuwissen writes:
Interspersed options/arguments are unregistered, aren't they?
No, not necessarily. Consider foo --help foo target_program --help or (going full inception) foo foo --any-flag
which is why
When the parser sees the first unregistered option it can just stop parsing.
isn't a good solution (though much better than the current state): parsing really needs to stop at the first *positional* argument, not at the first unrecognized option.
Point taken, but I think there may be a need for *both* behaviours. My use case would definitely become easier to implement if the command line parser could be instructed to stop at the first occurence of either a positional argument or an unrecognized option. So far I've been getting by with not registering the positional argument and reverting state for all arguments recognized after the first one that was not recognized. Hope this helps, -- Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- AVASYS CORPORATION FSF Associate Member #1962 Help support software freedom http://www.fsf.org/jf?referrer=1962