ArgMatches method to get the alias used (and long or short version) #3048
Labels
A-parsing
Area: Parser's logic and needs it changed somehow.
C-enhancement
Category: Raise on the bar on expectations
S-waiting-on-decision
Status: Waiting on a go/no-go before implementing
Please complete the following tasks
Clap Version
2.33.3
Describe your use case
I am trying to determine which variant of an option was used. For example, did the user type
--number
or just-n
.Describe the solution you'd like
I think
ArgMatches
should have a method similar tovalue_of
that would return this.Alternatives, if applicable
Here is my workaround.
Additional Context
I am trying to print more helpful error messages. For example, instead of
Failed to parse argument "number"
I could printFailed to parse argument "--limit"
.The text was updated successfully, but these errors were encountered: