1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

csplit: add support for -q

This commit is contained in:
Daniel Hofstetter 2024-12-26 09:40:55 +01:00
parent b9742067fe
commit db37c316af
2 changed files with 18 additions and 12 deletions

View file

@ -621,8 +621,9 @@ pub fn uu_app() -> Command {
) )
.arg( .arg(
Arg::new(options::QUIET) Arg::new(options::QUIET)
.short('s') .short('q')
.long(options::QUIET) .long(options::QUIET)
.visible_short_alias('s')
.visible_alias("silent") .visible_alias("silent")
.help("do not print counts of output file sizes") .help("do not print counts of output file sizes")
.action(ArgAction::SetTrue), .action(ArgAction::SetTrue),

View file

@ -387,18 +387,23 @@ fn test_option_keep() {
#[test] #[test]
fn test_option_quiet() { fn test_option_quiet() {
let (at, mut ucmd) = at_and_ucmd!(); for arg in ["-q", "--quiet", "-s", "--silent"] {
ucmd.args(&["--quiet", "numbers50.txt", "13", "%25%", "/0$/"]) let (at, mut ucmd) = at_and_ucmd!();
.succeeds() ucmd.args(&[arg, "numbers50.txt", "13", "%25%", "/0$/"])
.no_stdout(); .succeeds()
.no_stdout();
let count = glob(&at.plus_as_string("xx*")) let count = glob(&at.plus_as_string("xx*"))
.expect("there should be splits created") .expect("there should be splits created")
.count(); .count();
assert_eq!(count, 3); assert_eq!(count, 3);
assert_eq!(at.read("xx00"), generate(1, 13)); assert_eq!(at.read("xx00"), generate(1, 13));
assert_eq!(at.read("xx01"), generate(25, 30)); assert_eq!(at.read("xx01"), generate(25, 30));
assert_eq!(at.read("xx02"), generate(30, 51)); assert_eq!(at.read("xx02"), generate(30, 51));
at.remove("xx00");
at.remove("xx01");
at.remove("xx02");
}
} }
#[test] #[test]