-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinguish between not present and not defined Args #604
Comments
I agree this is an issue, and something I'm hoping to solve by proxy with the ability to use enums instead of strings (see #510). But this is all a breaking change and will be made on the 3.x branch which I'm hoping to get some time to work on in the next few weeks and actually be able to put out soon. Having |
I think I'd prefer to |
@kbknapp I've started working on this. I should have a pull request tomorrow after I update according to contribution guide |
For the record, I agree with using |
Emphasis on:
This is pretty much the same as what we do for |
Right now
ArgMatches::is_present(s)
checks whether the option with names
is present in the list of arguments or not. What aboutArg
s that have not been defined, and which I erroneously check for? Maybeis_present()
could return anOption<bool>
instead, withSome(bool)
in cases where a definedArg
was set/not set, andNone
in cases where the option does not appear in the list of definedArg
s.Assume the following example:
This function will of course always return false. However,
dbeug
was never actually defined in the first place, so it would be great if it complained about that.The text was updated successfully, but these errors were encountered: