Skip to content

Args that take multiple values of different types #5460

Answered by epage
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

So to understand, you have the following args:

  • --from <source game | metric> <source sensitivity> [DPI] (ie --from takes 2-3 values)
  • --to <target game | metric> [DPI] (ie --to takes 1-2 values)

One design alternative is #1704 which is also a bit in limbo though there might be a way around it with #2222.

If the set of args is few, you could consider making them subcommands without chaining. Depending on the design, this might not be ideal.

In the short term, you could just not parse the values within clap and just accept String and then parse them yourself.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant