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
{{ message }}
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.
I'd like to have a validation function that would validate the arguments together.
Describe the solution you'd like
I'm thinking something like this:
App::new("x").validate(|args| /* some logic and... */Err(("myarg","Why invalid"));
(I'm not married to this example, it is just so we can have an idea)
In this case, argument myarg is invalid, after I've gone through some logic that would go through all arguments already supplied (and validated individually).
Alternatives, if applicable
Validate after parsing using ArgMatches.
Additional context
Already discussed at #1913 and #1206, and I think a solution with a closure after on the app context could make sense.
The text was updated successfully, but these errors were encountered:
Issue by giggio
Saturday Feb 06, 2021 at 22:12 GMT
Originally opened as clap-rs/clap#2332
Make sure you completed the following tasks
Describe your use case
I'd like to have a validation function that would validate the arguments together.
Describe the solution you'd like
I'm thinking something like this:
(I'm not married to this example, it is just so we can have an idea)
In this case, argument
myarg
is invalid, after I've gone through some logic that would go through all arguments already supplied (and validated individually).Alternatives, if applicable
Validate after parsing using
ArgMatches
.Additional context
Already discussed at #1913 and #1206, and I think a solution with a closure after on the app context could make sense.
The text was updated successfully, but these errors were encountered: