diff --git a/src/uu/factor/Cargo.toml b/src/uu/factor/Cargo.toml index 218918762..ad0f05233 100644 --- a/src/uu/factor/Cargo.toml +++ b/src/uu/factor/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" num-traits = "0.2.15" # used in src/numerics.rs, which is included by build.rs [dependencies] -clap = { version = "3.2", features = ["wrap_help", "cargo"] } +clap = { version = "4.0", features = ["wrap_help", "cargo"] } coz = { version = "0.1.3", optional = true } num-traits = "0.2.15" # Needs at least version 0.2.15 for "OverflowingAdd" rand = { version = "0.8", features = ["small_rng"] } diff --git a/src/uu/factor/src/cli.rs b/src/uu/factor/src/cli.rs index 3c345ab48..1bf764ca6 100644 --- a/src/uu/factor/src/cli.rs +++ b/src/uu/factor/src/cli.rs @@ -15,7 +15,7 @@ use std::io::BufRead; use std::io::{self, stdin, stdout, Write}; mod factor; -use clap::{crate_version, Arg, Command}; +use clap::{crate_version, Arg, ArgAction, Command}; pub use factor::*; use uucore::display::Quotable; use uucore::error::UResult; @@ -78,10 +78,10 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { Ok(()) } -pub fn uu_app<'a>() -> Command<'a> { +pub fn uu_app() -> Command { Command::new(uucore::util_name()) .version(crate_version!()) .about(ABOUT) .infer_long_args(true) - .arg(Arg::new(options::NUMBER).multiple_occurrences(true)) + .arg(Arg::new(options::NUMBER).action(ArgAction::Append)) } diff --git a/tests/by-util/test_factor.rs b/tests/by-util/test_factor.rs index 5978b553f..92abf5b79 100644 --- a/tests/by-util/test_factor.rs +++ b/tests/by-util/test_factor.rs @@ -8,10 +8,8 @@ // spell-checker:ignore (methods) hexdigest -use tempfile::TempDir; - use crate::common::util::*; -use std::fs::OpenOptions; + use std::time::SystemTime; #[path = "../../src/uu/factor/sieve.rs"] @@ -33,9 +31,12 @@ fn test_invalid_arg() { } #[test] +#[cfg(feature = "sort")] fn test_parallel() { use hex_literal::hex; use sha1::{Digest, Sha1}; + use std::fs::OpenOptions; + use tempfile::TempDir; // factor should only flush the buffer at line breaks let n_integers = 100_000; let mut input_string = String::new();