We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
First of all, thanks for your work! I really appreciated the simplicity and power of this gem.
Currently, the following validation:
argument :foo do validate /\d+/ end
Would return the following error when passed --foo bar:
--foo bar
"value of bar fails validation for '--foo' option"
bar
But I have to check the source to know what is expected of --foo. Or hope it was documented in the desc.
--foo
desc
I'd like to either get something like (extracted with some Ruby magic):
"value of bar fails validation for '--foo' option, expected /\d+/"
Or, have the opportunity to specify the error message myself with something like:
argument :foo do validate /\d+/, "expected digit" end
I'm happy to come up with a better API (and potentially a PR) for either version if this is a change that you'd like to have.
Nothing as of now. But we may want to consider adding the same to the help.
help
The text was updated successfully, but these errors were encountered:
No branches or pull requests
First of all, thanks for your work! I really appreciated the simplicity and power of this gem.
Describe the problem
Currently, the following validation:
Would return the following error when passed
--foo bar
:But I have to check the source to know what is expected of
--foo
. Or hope it was documented in thedesc
.How would the new feature work?
I'd like to either get something like (extracted with some Ruby magic):
Or, have the opportunity to specify the error message myself with something like:
I'm happy to come up with a better API (and potentially a PR) for either version if this is a change that you'd like to have.
Drawbacks
Nothing as of now. But we may want to consider adding the same to the
help
.The text was updated successfully, but these errors were encountered: