ArgGroup With Clap Derive

I am creating a CLI in rust...how can I go about using an ArgGroup with the derive CLI.
Note: I do not mean with the builder function.
Here is something like what I am looking for:

#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
struct Cli {
    input: String,
    output: String,
    
    #[arg_group = "group"]
    flag1: bool,
    
    #[arg_group = "group"]
    flag2: bool,
}

Oops, I missed this part of the derive tutorial...now I feel dumb. I won't delete this in case someone else makes the same mistake that I did.

3 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.