mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-15 03:26:18 +00:00
Merge pull request #5962 from wolimst/cut/fix/multiple-mode-args
cut: show error for multiple mode args (`-b`, `-c`, `-f`)
This commit is contained in:
commit
6adaf31d49
2 changed files with 48 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