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

Merge pull request #6115 from BenWiederhake/dev-factor-repeat

factor: correctly handle repeated flag
This commit is contained in:
Sylvestre Ledru 2024-03-24 09:54:55 +01:00 committed by GitHub
commit 82550b43d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -103,6 +103,7 @@ pub fn uu_app() -> Command {
.override_usage(format_usage(USAGE))
.infer_long_args(true)
.disable_help_flag(true)
.args_override_self(true)
.arg(Arg::new(options::NUMBER).action(ArgAction::Append))
.arg(
Arg::new(options::EXPONENTS)

View file

@ -30,6 +30,15 @@ fn test_valid_arg_exponents() {
new_ucmd!().arg("--exponents").succeeds().code_is(0);
}
#[test]
fn test_repeated_exponents() {
new_ucmd!()
.args(&["-hh", "1234", "10240"])
.succeeds()
.stdout_only("1234: 2 617\n10240: 2^11 5\n")
.no_stderr();
}
#[test]
#[cfg(feature = "sort")]
#[cfg(not(target_os = "android"))]