Is there a way to use ArgGroup with #[derive(Clap)]? #2186
-
I have the following struct (clap v3): #[derive(Clap, Debug)]
pub struct App {
#[clap(group = "g", long)]
foo: Vec<String>,
#[clap(group = "g", long)]
bar: String,
#[clap(group = "g", long)]
baz: bool,
} How do I check which argument has been selected? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Can you describe your question more? What do you mean by selection here?
…On Mon, Oct 26, 2020, 22:03 ajeetdsouza ***@***.***> wrote:
I have the following struct:
#[derive(Clap, Debug)]pub struct App {
#[clap(group = "g", short)]
foo: Vec<String>,
#[clap(group = "g", short)]
bar: String,
#[clap(group = "g", short)]
baz: bool,
}
How do I check which argument has been selected?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2186>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABKU336BBSHF5LMCEFECCTSMXPZLANCNFSM4S75H5MA>
.
|
Beta Was this translation helpful? Give feedback.
-
@pksunkara since the arguments With the clap builder pattern, one would use |
Beta Was this translation helpful? Give feedback.
-
You can make them #[clap(group = "g", long)]
bar: Option<String>,
#[clap(group = "g", long)]
baz: Option<bool>, |
Beta Was this translation helpful? Give feedback.
You can make them
option
since they are all optional