feat: add __args

This commit is contained in:
2025-01-01 09:54:00 +08:00
parent 2ff99a832d
commit 744b16af6c
7 changed files with 546 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
use argh::FromArgs;
#[derive(Debug, FromArgs)]
/// Reach new heights.
struct GoUp {
/// whether or not to jump
#[argh(switch, short = 'j')]
jump: bool,
/// how high to go
#[argh(option)]
height: usize,
/// an optional nickname for the pilot
#[argh(option)]
pilot_nickname: Option<String>,
}
fn main() {
let up: GoUp = argh::from_env();
println!("{:#?}", up);
}