- arg
- long
Clap Single long argument
examples/clap/single-long-argument/Cargo.toml
[package] name = "single-long-argument" version = "0.1.0" edition = "2021" [dependencies] clap = { version = "4.5.7", features = ["derive"] }
examples/clap/single-long-argument/src/main.rs
use clap::Parser; #[derive(Parser)] struct Cli { #[arg(long)] host: String, } fn main() { let args = Cli::parse(); println!("host: {}", args.host); }