Skip to navigation
Adding a Command-Line to Rust App with with the clap struct way
19.08.24
```rust use clap::{Parser}; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] struct Args { 5 implementations #[arg(short, long, default_value_t = 0)] nox: u8, #[arg(short, long, default_value = "none")] save: String, } fn main() { ▶︎ Run |Debug let args = Args::parse(); println!("{:?}", args); } ```
https://www.joshfinnie.com/blog/a-command-line-application-in-rust/
Reply
Anonymous
Information Epoch 1741908650
Using text data files.
Home
Notebook
Contact us