Remove default signal from clap, leave it for parse

Fixes #239
This commit is contained in:
Félix Saparelli 2022-01-24 20:50:27 +13:00
parent b8b2c2ca70
commit 9b866ad9e8
No known key found for this signature in database
GPG Key ID: B948C4BAE44FC474
4 changed files with 9 additions and 25 deletions

View File

@ -68,9 +68,7 @@ pub fn get_args(tagged_filterer: bool) -> Result<ArgMatches<'static>> {
.short("s")
.long("signal")
.takes_value(true)
.value_name("signal")
.default_value("SIGTERM")
.hidden(cfg!(windows)))
.value_name("signal"))
.arg(Arg::with_name("kill")
.help_heading(Some(OPTSET_BEHAVIOUR))
.hidden(true)

View File

@ -279,48 +279,33 @@ fn os_split_leading() {
#[test]
fn os_strip_none() {
let os = OsString::from("abc");
assert_eq!(
os_strip_prefix(os, b'.'),
OsString::from("abc")
);
assert_eq!(os_strip_prefix(os, b'.'), OsString::from("abc"));
}
#[cfg(test)]
#[test]
fn os_strip_left() {
let os = OsString::from(".abc");
assert_eq!(
os_strip_prefix(os, b'.'),
OsString::from("abc")
);
assert_eq!(os_strip_prefix(os, b'.'), OsString::from("abc"));
}
#[cfg(test)]
#[test]
fn os_strip_not_right() {
let os = OsString::from("abc.");
assert_eq!(
os_strip_prefix(os, b'.'),
OsString::from("abc.")
);
assert_eq!(os_strip_prefix(os, b'.'), OsString::from("abc."));
}
#[cfg(test)]
#[test]
fn os_strip_only_left() {
let os = OsString::from(".abc.");
assert_eq!(
os_strip_prefix(os, b'.'),
OsString::from("abc.")
);
assert_eq!(os_strip_prefix(os, b'.'), OsString::from("abc."));
}
#[cfg(test)]
#[test]
fn os_strip_only_once() {
let os = OsString::from("..abc");
assert_eq!(
os_strip_prefix(os, b'.'),
OsString::from(".abc")
);
assert_eq!(os_strip_prefix(os, b'.'), OsString::from(".abc"));
}

View File

@ -1,5 +1,6 @@
---
source: cli/tests/help.rs
assertion_line: 16
expression: "String::from_utf8(output.stdout).unwrap()"
---
@ -39,8 +40,7 @@ OPTIONS:
-w, --watch <path>... Watch a specific file or directory
--force-poll <interval> Force polling mode (interval in milliseconds)
--shell <shell> Use a different shell, or `none`. E.g. --shell=bash
-s, --signal <signal> Specify the signal to send when using --on-busy-update=signal [default:
SIGTERM]
-s, --signal <signal> Specify the signal to send when using --on-busy-update=signal
ARGS:
<command>... Command to execute

View File

@ -40,6 +40,7 @@ OPTIONS:
--force-poll <interval> Force polling mode (interval in milliseconds)
--shell <shell> Use a different shell, or `none`. Try --shell=powershell, which will become
the default in 2.0.
-s, --signal <signal> Specify the signal to send when using --on-busy-update=signal
ARGS:
<command>... Command to execute