Allow passing args to , watch
This commit is contained in:
parent
1ff8e396cb
commit
9f448de544
2 changed files with 24 additions and 3 deletions
|
@ -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";
|
||||
};
|
||||
};
|
||||
|
|
22
src/main.rs
22
src/main.rs
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue