-
Hi there! I am working on a CLI tool for converting sensitivities between games, but I am not sure exactly how to structure it, or if what I want is possible with Clap. Here is an example of how I want the program to work:
After doing some research, I stumbled across #1717 (comment), which seems like what I'm looking for, but the issue has been open for a while, and it seems to be a challenging feature to implement. So, what are some solutions I can explore? This is something I've been stuck on for the past few days. I'm quite new to Rust, so apologies if this is a very newbie question lol, and thank you for the help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
So to understand, you have the following args:
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 |
Beta Was this translation helpful? Give feedback.
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 acceptString
and then parse them yourself.