Clap show the version number from Cargo.toml
- version
use clap::Parser;
#[derive(Parser)]
#[command(version)]
struct Cli {}
fn main() {
let _args = Cli::parse();
println!("Hello World!");
}
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
use clap::Parser;
#[derive(Parser)]
#[command(version)]
struct Cli {}
fn main() {
let _args = Cli::parse();
println!("Hello World!");
}