jacobdeichert/mask

Allow entering negative numbers

jacobdeichert opened this issue · 1 comments

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?

Oh... i completely missed AllowNegativeNumbers...

That's the fix.