From 5cfed8963f13d93dc527ecd986f99f4ceeb7960e Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Mon, 14 Aug 2023 18:38:00 -0400 Subject: [PATCH] Flag parsing bugfix --- Cargo.lock | 2 +- src/main.rs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index af2950c..c93ff87 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,7 +295,7 @@ dependencies = [ [[package]] name = "runwhen" -version = "0.0.5" +version = "0.0.6" dependencies = [ "clap", "humantime", diff --git a/src/main.rs b/src/main.rs index b96cf4c..ed103d9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,10 +45,9 @@ fn do_flags() -> clap::ArgMatches { .about("Trigger that fires when a file or directory changes.") .arg( arg!(-f --file) - .name("filetouch") - .value_parser(value_parser!(PathBuf)).help("File or directory to watch for changes"), + .takes_value(true).value_parser(value_parser!(PathBuf)).help("File or directory to watch for changes"), ) - .arg(arg!(--touch).help("Use file or directory timestamps to monitor for changes.")) + .arg(arg!(--touch).name("filetouch").help("Use file or directory timestamps to monitor for changes.")) .arg(arg!(--poll).value_parser(value_parser!(humantime::Duration)).help("Duration of time between polls"))) .subcommand( clap::Command::new("timer")