clap/tests/derive_ui/group_name_attribute.rs
Kurtis Nusbaum 5430df7a0f feat(derive): Support #[group] attributes
This adds the ability derive additional options for the group creation.

Fixes #4574
2023-03-25 03:25:38 -05:00

23 lines
360 B
Rust

use clap::Parser;
#[derive(Parser, Debug)]
#[command(name = "basic")]
struct Opt {
#[command(flatten)]
source: Source,
}
#[derive(clap::Args, Debug)]
#[group(required = true, name = "src")]
struct Source {
#[arg(short)]
git: String,
#[arg(short)]
path: String,
}
fn main() {
let opt = Opt::parse();
println!("{:?}", opt);
}