Skip to content
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

Allow entering negative numbers #33

Closed
jacobdeichert opened this issue Sep 25, 2019 · 1 comment · Fixed by #34
Closed

Allow entering negative numbers #33

jacobdeichert opened this issue Sep 25, 2019 · 1 comment · Fixed by #34
Labels
bug Something isn't working

Comments

@jacobdeichert
Copy link
Owner

Clap by default doesn't allow arg values to start with a hyphen.

This becomes problematic for number values...

$ mask add 2 -3
error: Found argument '-3' which wasn't expected, or isn't valid in this context

USAGE:
    mask add [FLAGS] <a> <b>

For more information try --help

There's two settings:

And this is the caveat:

NOTE: Use this setting with caution as it silences certain circumstances which would otherwise be an error (such as accidentally forgetting to specify a value for leading option). It is preferred to set this on a per argument basis, via Arg::allow_hyphen_values

Maybe after #3 is done, we can enable this option only for number args?

@jacobdeichert jacobdeichert added the bug Something isn't working label Sep 25, 2019
@jacobdeichert
Copy link
Owner Author

Oh... i completely missed AllowNegativeNumbers...

That's the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant