mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
tr: enable passing -t multiple times
This commit is contained in:
+2
-1
@@ -199,7 +199,8 @@ pub fn uu_app() -> Command {
|
||||
.long(options::TRUNCATE_SET1)
|
||||
.short('t')
|
||||
.help("first truncate SET1 to length of SET2")
|
||||
.action(ArgAction::SetTrue),
|
||||
.action(ArgAction::SetTrue)
|
||||
.overrides_with(options::TRUNCATE_SET1),
|
||||
)
|
||||
.arg(Arg::new(options::SETS).num_args(1..))
|
||||
}
|
||||
|
||||
@@ -300,7 +300,16 @@ fn test_truncate() {
|
||||
new_ucmd!()
|
||||
.args(&["-t", "abc", "xy"])
|
||||
.pipe_in("abcde")
|
||||
.run()
|
||||
.succeeds()
|
||||
.stdout_is("xycde"); // spell-checker:disable-line
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_truncate_multi() {
|
||||
new_ucmd!()
|
||||
.args(&["-tt", "-t", "abc", "xy"])
|
||||
.pipe_in("abcde")
|
||||
.succeeds()
|
||||
.stdout_is("xycde"); // spell-checker:disable-line
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user