clap/tests/derive_ui/group_name_attribute.rs
2023-05-04 15:58:04 -04:00

23 lines
358 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:?}");
}