mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 17:58:06 +00:00
sort: print check messages to stderr, not stdout
This commit is contained in:
parent
891d25cebd
commit
c6e044927c
2 changed files with 5 additions and 5 deletions
|
@ -56,7 +56,7 @@ pub fn check(path: &str, settings: &GlobalSettings) -> i32 {
|
||||||
) == Ordering::Greater
|
) == Ordering::Greater
|
||||||
{
|
{
|
||||||
if !settings.check_silent {
|
if !settings.check_silent {
|
||||||
println!("sort: {}:{}: disorder: {}", path, line_idx, new_first.line);
|
eprintln!("sort: {}:{}: disorder: {}", path, line_idx, new_first.line);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ pub fn check(path: &str, settings: &GlobalSettings) -> i32 {
|
||||||
if compare_by(a, b, settings, chunk.line_data(), chunk.line_data()) == Ordering::Greater
|
if compare_by(a, b, settings, chunk.line_data(), chunk.line_data()) == Ordering::Greater
|
||||||
{
|
{
|
||||||
if !settings.check_silent {
|
if !settings.check_silent {
|
||||||
println!("sort: {}:{}: disorder: {}", path, line_idx, b.line);
|
eprintln!("sort: {}:{}: disorder: {}", path, line_idx, b.line);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,7 +181,7 @@ fn test_check_zero_terminated_failure() {
|
||||||
.arg("-c")
|
.arg("-c")
|
||||||
.arg("zero-terminated.txt")
|
.arg("zero-terminated.txt")
|
||||||
.fails()
|
.fails()
|
||||||
.stdout_is("sort: zero-terminated.txt:2: disorder: ../../fixtures/du\n");
|
.stderr_only("sort: zero-terminated.txt:2: disorder: ../../fixtures/du\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -775,13 +775,13 @@ fn test_check() {
|
||||||
.arg(diagnose_arg)
|
.arg(diagnose_arg)
|
||||||
.arg("check_fail.txt")
|
.arg("check_fail.txt")
|
||||||
.fails()
|
.fails()
|
||||||
.stdout_is("sort: check_fail.txt:6: disorder: 5\n");
|
.stderr_only("sort: check_fail.txt:6: disorder: 5\n");
|
||||||
|
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.arg(diagnose_arg)
|
.arg(diagnose_arg)
|
||||||
.arg("multiple_files.expected")
|
.arg("multiple_files.expected")
|
||||||
.succeeds()
|
.succeeds()
|
||||||
.stdout_is("");
|
.stderr_is("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue