Replies: 1 comment 2 replies
-
This would run counter to the intention of the escaped arguments: they are unparsed values. You could then take those arguments and parse them as you need. If you want them to be completely dynamic like this, you could use something like |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a (derive) way to parse "raw" arguments into a map? I see here a reference on parsing escaped arguments after
--
. So as the example shows, the following struct:is parsed as follows:
I was wondering if there was a built-in way to parse these raw arguments into a map. So the above example (modified) would yield something like:
In general, I'd like if something along the following lines holds true:
-
) is passed and the next token is not an argument, map that value to that argument (i.e.,--option value
would map "option" to "value")-sSl
becomes three separate mappings fors
,S
, andl
=
, it is sliced on the first equal into a key-value pair (i.e.,--option=value
would map "option" to "value")sloppy slop slop slop
) an error is thrownIt doesn't have to be that specific, but I was wondering if clap has any built-in functionality for this sort of behavior, or if we are left to parse these kinds of arguments ourselves.
Beta Was this translation helpful? Give feedback.
All reactions