Allow passing args to , watch

This commit is contained in:
Sridhar Ratnakumar 2023-06-26 15:24:25 -04:00
parent 1ff8e396cb
commit 9f448de544
2 changed files with 24 additions and 3 deletions

View file

@ -83,7 +83,10 @@
}; };
watch = { watch = {
exec = ''cargo watch -x run''; exec = ''
set -x
cargo watch -x "run -- $*"
'';
description = "Watch for changes and run the project executable"; description = "Watch for changes and run the project executable";
}; };
}; };

View file

@ -1,3 +1,21 @@
fn main() { use argh::FromArgs;
println!("Hello World!");
#[derive(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();
} }