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 = {
exec = ''cargo watch -x run'';
exec = ''
set -x
cargo watch -x "run -- $*"
'';
description = "Watch for changes and run the project executable";
};
};

View file

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