You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I setup an ArgumentParser with both short and long options AND the long option prefix is empty (""), the short options are never parsed, eg.
args::ArgumentParser parser("This is a test program.", "This goes after the options."); parser.ShortPrefix("-"); parser.LongPrefix(""); parser.LongSeparator("="); args::ValueFlag<int> counter(parser, "integer", "The counter value", {'c', "counter"});
This works ok..
./test counter=3
But this does not..
./test -i 3
The text was updated successfully, but these errors were encountered:
That's tough. I'd prefer unambiguous parsing in most cases. An empty long prefix will always be matched, because long options take precedence over short. Options aren't required to be alphanumeric, and -v could be an actual long-option name (matching the empty-string long prefix). That said, I see why you'd want the behavior you'd expect, because usually that's the way you'd really want it to behave.
Why the restriction on long separator containing both whitespace and non-whitespace characters? I don't see a reason to prevent the long separator from being any arbitrary string, as silly as it might be. If somebody is doing something ridiculous like having their long separator : so they can specify options with 'optionname: value', that would break it.
If I setup an ArgumentParser with both short and long options AND the long option prefix is empty (""), the short options are never parsed, eg.
args::ArgumentParser parser("This is a test program.", "This goes after the options."); parser.ShortPrefix("-"); parser.LongPrefix(""); parser.LongSeparator("="); args::ValueFlag<int> counter(parser, "integer", "The counter value", {'c', "counter"});
This works ok..
./test counter=3
But this does not..
./test -i 3
The text was updated successfully, but these errors were encountered: