Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/uu/csplit/src/csplit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,9 @@ pub fn uu_app() -> Command {
)
.arg(
Arg::new(options::QUIET)
.short('s')
.short('q')
.long(options::QUIET)
.visible_short_alias('s')
.visible_alias("silent")
.help("do not print counts of output file sizes")
.action(ArgAction::SetTrue),
Expand Down
27 changes: 16 additions & 11 deletions tests/by-util/test_csplit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,18 +387,23 @@ fn test_option_keep() {

#[test]
fn test_option_quiet() {
let (at, mut ucmd) = at_and_ucmd!();
ucmd.args(&["--quiet", "numbers50.txt", "13", "%25%", "/0$/"])
.succeeds()
.no_stdout();
for arg in ["-q", "--quiet", "-s", "--silent"] {
let (at, mut ucmd) = at_and_ucmd!();
ucmd.args(&[arg, "numbers50.txt", "13", "%25%", "/0$/"])
.succeeds()
.no_stdout();

let count = glob(&at.plus_as_string("xx*"))
.expect("there should be splits created")
.count();
assert_eq!(count, 3);
assert_eq!(at.read("xx00"), generate(1, 13));
assert_eq!(at.read("xx01"), generate(25, 30));
assert_eq!(at.read("xx02"), generate(30, 51));
let count = glob(&at.plus_as_string("xx*"))
.expect("there should be splits created")
.count();
assert_eq!(count, 3);
assert_eq!(at.read("xx00"), generate(1, 13));
assert_eq!(at.read("xx01"), generate(25, 30));
assert_eq!(at.read("xx02"), generate(30, 51));
at.remove("xx00");
at.remove("xx01");
at.remove("xx02");
}
}

#[test]
Expand Down
Loading