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
When the global setting AllowLeadingHyphen is set and the app has at least one argument registered, Clap doesn't return an error if the program is called with an unknown, unexpected argument (it doesn't even have to start with a hyphen)
This should only happen if there is something expecting a value, i.e. if the unknown/unexpected argument could possibly be a value to some other argument (either positional or option). This is because clap can't really know if something starting with a hyphen is supposed to be a value, or just an incorrect flag/option.
If this isn't the case, i.e. there's no possible way it could be a valid value and it's still not detecting the error then that's a bug.
I haven't tested this yet on my machine as I'll have to do that when I get home, so this may very well be the bug you're suggesting 😉 I just wanted to lay out how this is supposed to work in a bug free world.
On a side note, if possible I recommend only using this setting for individual args via Arg::allow_hyphen_values
rustc 1.18.0 / clap 2.26.0
When the global setting AllowLeadingHyphen is set and the app has at least one argument registered, Clap doesn't return an error if the program is called with an unknown, unexpected argument (it doesn't even have to start with a hyphen)
Sample Code / Steps to Reproduce the Issue
The text was updated successfully, but these errors were encountered: