Replies: 1 comment 3 replies
-
Tuples are not supported at this time (#1717). You'd need something like #[derive(Parser)]
pub struct UpdateCommand {
#[arg(long, num_args=1..=2)]
pub patches: Vec<Vec<Value>>,
} and then manually convert / validate |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is pretty unconventional, I want to make a command to modify a
json::Map<String, json::Value>
where I can provide
key
and an optionalvalue
to overwrite it with, no value meaning remove.It would call something like this
cargo run -- update -v foo -v bar new_value
(
foo
gets removed,bar
gets updated)I tried this, but the
Parser
derive didn't like it:I couldn't find a related example, issue or discussion.
If you have alternatives, I'm open for suggestions, but I wanna keep the ability to 'bulk' edit with a single command
Beta Was this translation helpful? Give feedback.
All reactions