mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
cut: show error for multiple mode args (-b, -c, -f)
This commit is contained in:
parent
dd64bae278
commit
cb0ce0e1cb
2 changed files with 38 additions and 7 deletions
|
@ -270,3 +270,21 @@ fn test_multiple() {
|
|||
assert_eq!(result.stdout_str(), "b\n");
|
||||
assert_eq!(result.stderr_str(), "");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_multiple_mode_args() {
|
||||
for args in [
|
||||
vec!["-b1", "-b2"],
|
||||
vec!["-c1", "-c2"],
|
||||
vec!["-f1", "-f2"],
|
||||
vec!["-b1", "-c2"],
|
||||
vec!["-b1", "-f2"],
|
||||
vec!["-c1", "-f2"],
|
||||
vec!["-b1", "-c2", "-f3"],
|
||||
] {
|
||||
new_ucmd!()
|
||||
.args(&args)
|
||||
.fails()
|
||||
.stderr_is("cut: invalid usage: expects no more than one of --fields (-f), --chars (-c) or --bytes (-b)\n");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue