Skip to main content

#
02_apps_derive/
02_apps.rs

    1use clap::Parser;
    2
    3#[derive(Parser)]
    4#[command(name = "MyApp")]
    5#[command(version = "1.0")]
    6#[command(about = "Does awesome things", long_about = None)]
    7struct Cli {
    8    #[arg(long)]
    9    two: String,
    10    #[arg(long)]
    11    one: String,
    12}
    13
    14fn main() {
    15    let cli = Cli::parse();
    16
    17    println!("two: {:?}", cli.two);
    18    println!("one: {:?}", cli.one);
    19}