tr: enable passing -s multiple times

This commit is contained in:
Ben Wiederhake
2024-02-24 18:37:45 +01:00
parent dc664006fe
commit 268af90843
2 changed files with 22 additions and 3 deletions
+2 -1
View File
@@ -191,7 +191,8 @@ pub fn uu_app() -> Command {
listed in the last specified SET, with a single occurrence \
of that character",
)
.action(ArgAction::SetTrue),
.action(ArgAction::SetTrue)
.overrides_with(options::SQUEEZE),
)
.arg(
Arg::new(options::TRUNCATE_SET1)
+20 -2
View File
@@ -182,7 +182,16 @@ fn test_squeeze() {
new_ucmd!()
.args(&["-s", "a-z"])
.pipe_in("aaBBcDcc")
.run()
.succeeds()
.stdout_is("aBBcDc");
}
#[test]
fn test_squeeze_multi() {
new_ucmd!()
.args(&["-ss", "-s", "a-z"])
.pipe_in("aaBBcDcc")
.succeeds()
.stdout_is("aBBcDc");
}
@@ -191,7 +200,16 @@ fn test_squeeze_complement() {
new_ucmd!()
.args(&["-sc", "a-z"])
.pipe_in("aaBBcDcc")
.run()
.succeeds()
.stdout_is("aaBcDcc");
}
#[test]
fn test_squeeze_complement_multi() {
new_ucmd!()
.args(&["-scsc", "a-z"]) // spell-checker:disable-line
.pipe_in("aaBBcDcc")
.succeeds()
.stdout_is("aaBcDcc");
}