- short
Clap Short arguments
- We can allow to use -x short names (defaults to the first letter of the attribute)
- We can set the letter ourselves.
examples/clap/short-arguments/src/main.rs
use clap::Parser; #[derive(Parser)] struct Cli { #[arg(short)] debug: bool, #[arg(short = 'H')] host: String, } fn main() { let args = Cli::parse(); println!("debug: {}", args.debug); println!("host: {}", args.host); }