Add -h testing

This commit is contained in:
Félix Saparelli 2021-12-29 19:56:02 +13:00
parent 736f7f1270
commit b5da4e31ba
No known key found for this signature in database
GPG Key ID: B948C4BAE44FC474
3 changed files with 24 additions and 2 deletions

View File

@ -22,3 +22,25 @@ fn help() {
String::from_utf8(output.stdout).unwrap()
);
}
#[test]
fn help_short() {
let long = Command::cargo_bin("watchexec")
.unwrap()
.arg("--help")
.output()
.unwrap();
let short = Command::cargo_bin("watchexec")
.unwrap()
.arg("--help")
.output()
.unwrap();
assert!(short.status.success(), "-h returns 0");
assert_eq!(short.stderr, Vec::<u8>::new(), "-h stderr is empty");
assert_eq!(
long.stdout, short.stdout,
"--help and -h output are the same"
);
}

View File

@ -17,7 +17,7 @@ FLAGS:
--no-global-ignore Skip auto-loading of global or environment-wide ignore files
--no-meta Ignore metadata changes
--no-process-group Do not use a process group when running the command
--no-ignore Skip auto-loading of project ignore files (.gitignore, .ignore, etc.)
--no-ignore Skip auto-loading of project ignore files (.gitignore, .ignore, etc)
-n, --no-shell Do not wrap command in a shell. Deprecated: use --shell=none instead.
--no-vcs-ignore Skip auto-loading of VCS (Git, etc) ignore files
-N, --notify Send a desktop notification when the command ends

View File

@ -17,7 +17,7 @@ FLAGS:
--no-global-ignore Skip auto-loading of global or environment-wide ignore files
--no-meta Ignore metadata changes
--no-process-group Do not use a process group when running the command
--no-ignore Skip auto-loading of project ignore files (.gitignore, .ignore, etc.)
--no-ignore Skip auto-loading of project ignore files (.gitignore, .ignore, etc)
-n, --no-shell Do not wrap command in a shell. Deprecated: use --shell=none instead.
--no-vcs-ignore Skip auto-loading of VCS (Git, etc) ignore files
-N, --notify Send a desktop notification when the command ends