1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 20:17:45 +00:00

Merge pull request #5671 from Yykz/wc_args_override

wc: fix arguments not overriding
This commit is contained in:
Sylvestre Ledru 2023-12-18 15:56:10 +01:00 committed by GitHub
commit ece9e91593
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -395,6 +395,7 @@ pub fn uu_app() -> Command {
.about(ABOUT)
.override_usage(format_usage(USAGE))
.infer_long_args(true)
.args_override_self(true)
.arg(
Arg::new(options::BYTES)
.short('c')

View file

@ -725,3 +725,16 @@ fn files0_from_dir() {
.fails()
.stderr_only(dir_err!("-"));
}
#[test]
fn test_args_override() {
new_ucmd!()
.args(&["-ll", "-l", "alice_in_wonderland.txt"])
.run()
.stdout_is("5 alice_in_wonderland.txt\n");
new_ucmd!()
.args(&["--total=always", "--total=never", "alice_in_wonderland.txt"])
.run()
.stdout_is(" 5 57 302 alice_in_wonderland.txt\n");
}