mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
Merge pull request #2461 from miDeb/sort/check-no-out
sort: disable -o with -C and -c
This commit is contained in:
commit
7a0a7aecc4
2 changed files with 16 additions and 0 deletions
|
@ -1198,12 +1198,14 @@ pub fn uu_app() -> App<'static, 'static> {
|
||||||
options::check::QUIET,
|
options::check::QUIET,
|
||||||
options::check::DIAGNOSE_FIRST,
|
options::check::DIAGNOSE_FIRST,
|
||||||
])
|
])
|
||||||
|
.conflicts_with(options::OUTPUT)
|
||||||
.help("check for sorted input; do not sort"),
|
.help("check for sorted input; do not sort"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name(options::check::CHECK_SILENT)
|
Arg::with_name(options::check::CHECK_SILENT)
|
||||||
.short("C")
|
.short("C")
|
||||||
.long(options::check::CHECK_SILENT)
|
.long(options::check::CHECK_SILENT)
|
||||||
|
.conflicts_with(options::OUTPUT)
|
||||||
.help("exit successfully if the given file is already sorted, and exit with status 1 otherwise."),
|
.help("exit successfully if the given file is already sorted, and exit with status 1 otherwise."),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
|
|
@ -937,3 +937,17 @@ fn test_sigpipe_panic() {
|
||||||
Ok(String::new())
|
Ok(String::new())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_conflict_check_out() {
|
||||||
|
let check_flags = ["-c=silent", "-c=quiet", "-c=diagnose-first", "-c", "-C"];
|
||||||
|
for check_flag in &check_flags {
|
||||||
|
new_ucmd!()
|
||||||
|
.arg(check_flag)
|
||||||
|
.arg("-o=/dev/null")
|
||||||
|
.fails()
|
||||||
|
.stderr_contains(
|
||||||
|
"error: The argument '--output <FILENAME>' cannot be used with '--check",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue