mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
594c535ba2
Most errors detected and fixed with Topy (https://github.com/intgr/topy), all verified by hand.
15 lines
429 B
Rust
15 lines
429 B
Rust
//! How to derive the author, description, and version from Cargo.toml
|
|
|
|
use clap::Clap;
|
|
|
|
#[derive(Clap, Debug)]
|
|
#[clap(author, about, version)]
|
|
// ^^^^^^ <- derive author from Cargo.toml
|
|
// ^^^^^ <- derive description from Cargo.toml
|
|
// ^^^^^^^ <- derive version from Cargo.toml
|
|
struct Opt {}
|
|
|
|
fn main() {
|
|
let opt = Opt::parse();
|
|
println!("{:?}", opt);
|
|
}
|