From 70e8a4dff2404a4aac1030148dc88d46040d3629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 24 Aug 2021 22:53:44 +1200 Subject: [PATCH] Fix cli tests --- .editorconfig | 4 ++++ cli/src/args.rs | 1 + cli/tests/snapshots/help__help_unix.snap | 7 ++++--- cli/tests/snapshots/help__help_windows.snap | 5 +++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index ec7dee8..6209041 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,6 +8,10 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true +[cli/tests/snapshots/*] +indent_style = space +trim_trailing_whitespace = false + [*.{md,ronn}] indent_style = space indent_size = 4 diff --git a/cli/src/args.rs b/cli/src/args.rs index 5912f78..c9f3175 100644 --- a/cli/src/args.rs +++ b/cli/src/args.rs @@ -27,6 +27,7 @@ pub fn get_args() -> Result> { .help("Watch a specific file or directory") .short("w") .long("watch") + .value_name("path") .number_of_values(1) .multiple(true) .takes_value(true)) diff --git a/cli/tests/snapshots/help__help_unix.snap b/cli/tests/snapshots/help__help_unix.snap index be91b33..a6abada 100644 --- a/cli/tests/snapshots/help__help_unix.snap +++ b/cli/tests/snapshots/help__help_unix.snap @@ -10,7 +10,6 @@ USAGE: watchexec [FLAGS] [OPTIONS] ... FLAGS: - --changes-only Only print path change information. Overridden by --verbose -c, --clear Clear screen before executing command -h, --help Prints help information --no-default-ignore Skip auto-ignoring of commonly ignored globs @@ -23,9 +22,10 @@ FLAGS: -N, --notify Send a desktop notification when watchexec notices a change (experimental, behaviour may change) -p, --postpone Wait until first change to execute command + --print-events Print events that trigger actions -r, --restart Restart the process if it's still running. Shorthand for --on-busy-update=restart -V, --version Prints version information - -v, --verbose Print debugging messages to stderr + -v, --verbose Print debugging messages (-v, -vv, -vvv; use -vvv for bug reports) -W, --watch-when-idle Deprecated alias for --on-busy-update=do-nothing, which will become the default in 2.0. OPTIONS: @@ -40,7 +40,8 @@ OPTIONS: -w, --watch ... Watch a specific file or directory --force-poll Force polling mode (interval in milliseconds) --shell Use a different shell, or `none`. E.g. --shell=bash - -s, --signal Send signal to process upon changes, e.g. SIGHUP + -s, --signal Specify the signal to send when using --on-busy-update=signal [default: + SIGTERM] ARGS: ... Command to execute diff --git a/cli/tests/snapshots/help__help_windows.snap b/cli/tests/snapshots/help__help_windows.snap index a30d826..3c96ad0 100644 --- a/cli/tests/snapshots/help__help_windows.snap +++ b/cli/tests/snapshots/help__help_windows.snap @@ -23,9 +23,10 @@ FLAGS: -N, --notify Send a desktop notification when watchexec notices a change (experimental, behaviour may change) -p, --postpone Wait until first change to execute command + --print-events Print events that trigger actions -r, --restart Restart the process if it's still running. Shorthand for --on-busy-update=restart -V, --version Prints version information - -v, --verbose Print debugging messages to stderr + -v, --verbose Print debugging messages (-v, -vv, -vvv; use -vvv for bug reports) -W, --watch-when-idle Deprecated alias for --on-busy-update=do-nothing, which will become the default in 2.0. OPTIONS: @@ -41,10 +42,10 @@ OPTIONS: --force-poll Force polling mode (interval in milliseconds) --shell Use a different shell, or `none`. Try --shell=powershell, which will become the default in 2.0. - -s, --signal Send signal to process upon changes, e.g. SIGHUP ARGS: ... Command to execute Use @argfile as first argument to load arguments from the file `argfile` (one argument per line) which will be inserted in place of the @argfile (further arguments on the CLI will override or add onto those in the file). +