Replies: 1 comment 2 replies
-
If I'm understanding the concern, it is
To me, the solution you gave seems reasonable. I see it as unlikely that there is enough of an agreed-to sub-language for content within values for it to be worth As for help, if its that complicated of content you are populating, I feel like any kind of auto-generated help output would be insufficient. Something that may be worth experimenting with is to hint at the structure through your |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I don't want to have to write clap parsers when you need a repeating set of commands, e.g.
set: Vec<KeyValueGroup>
. wherestruct KeyValueGroup { key: String, value: String }
where theKeyValueGroup
fields are positional arguments.e.g.
this is a simple example, it's much worse in the real world you where you have more complicated types other than String, and where you want specify the parser to use for the positional argument.
instead of this, you have to define a parser and change how you specify the key+value so you end up with a single argument string for each vec item.
e.g.
this is exponentially worse when one of your values needs to contain a seperator, e.g.
yikes!
also, the solution above is not at all user friendly when it comes to using the
--help
output.Here's a code snippet for the above, which I'm sure we'll all agree really should be able to be done out-of-the-box.
If anyone has any idea on how to do this better, I'm all ears.
If we need a new issue for this need, perhaps for Clap V5, let me know and I can open one.
Beta Was this translation helpful? Give feedback.
All reactions