Clap show the version number from Cargo.toml



examples/clap/show-version-number/src/main.rs
use clap::Parser;

#[derive(Parser)]
#[command(version)]
struct Cli {
}

fn main() {
    let _args = Cli::parse();
    println!("Hello World!");
}