Add -h testing
This commit is contained in:
parent
736f7f1270
commit
b5da4e31ba
|
@ -22,3 +22,25 @@ fn help() {
|
||||||
String::from_utf8(output.stdout).unwrap()
|
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"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ FLAGS:
|
||||||
--no-global-ignore Skip auto-loading of global or environment-wide ignore files
|
--no-global-ignore Skip auto-loading of global or environment-wide ignore files
|
||||||
--no-meta Ignore metadata changes
|
--no-meta Ignore metadata changes
|
||||||
--no-process-group Do not use a process group when running the command
|
--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.
|
-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
|
--no-vcs-ignore Skip auto-loading of VCS (Git, etc) ignore files
|
||||||
-N, --notify Send a desktop notification when the command ends
|
-N, --notify Send a desktop notification when the command ends
|
||||||
|
|
|
@ -17,7 +17,7 @@ FLAGS:
|
||||||
--no-global-ignore Skip auto-loading of global or environment-wide ignore files
|
--no-global-ignore Skip auto-loading of global or environment-wide ignore files
|
||||||
--no-meta Ignore metadata changes
|
--no-meta Ignore metadata changes
|
||||||
--no-process-group Do not use a process group when running the command
|
--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.
|
-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
|
--no-vcs-ignore Skip auto-loading of VCS (Git, etc) ignore files
|
||||||
-N, --notify Send a desktop notification when the command ends
|
-N, --notify Send a desktop notification when the command ends
|
||||||
|
|
Loading…
Reference in New Issue