1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

tr: enable passing -s multiple times

This commit is contained in:
Ben Wiederhake 2024-02-24 18:23:51 +01:00
parent dc664006fe
commit 268af90843
2 changed files with 22 additions and 3 deletions

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)

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");
}