diff --git a/flake.nix b/flake.nix index 3a46899..4cb2fbd 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; }; }; diff --git a/src/main.rs b/src/main.rs index 47ad8c6..25c12be 100644 --- a/src/main.rs +++ b/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, +} + +fn main() { + let up: GoUp = argh::from_env(); }