Can clap provide a new method to conditionally set the valid value of arguments? #5952
vanguardCLY
started this conversation in
Ideas
Replies: 1 comment
-
This reads as a potentially different way of looking at #5950. On top of the answer given there, a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In the existing clap method,
value_parser()
can realize the setting of valid values of arguments. However, in some scenarios, the valid value of a argument is not fixed, and the valid value of this argument needs to be specified conditionally based on the values of other arguments. For example, there are two arguments, one istype
, and the valid values area1
anda2
; the other isfmt
. Whentype=a1
, the valid values offmt
areb1
andb2
, and whentype=a2
, the valid values offmt
areb2
andb3
. Can clap introduce an new method, say namedvalue_parser_if()
, to fulfill this functionality? Thank you!Beta Was this translation helpful? Give feedback.
All reactions