mirror of
https://github.com/ouch-org/ouch.git
synced 2025-07-18 23:50:35 +00:00
Rename --threads
to --concurrency
And add alias to previous name
This commit is contained in:
parent
cffa37741a
commit
6a3c6496fc
@ -45,9 +45,9 @@ pub struct CliArgs {
|
||||
#[arg(short = 'p', long = "password", global = true)]
|
||||
pub password: Option<OsString>,
|
||||
|
||||
/// Concurrent working threads
|
||||
#[arg(short = 'c', long, global = true)]
|
||||
pub threads: Option<usize>,
|
||||
/// Limit the amount of concurrent threads available
|
||||
#[arg(short, long, visible_alias = "threads", global = true)]
|
||||
pub concurrency: Option<usize>,
|
||||
|
||||
// Ouch and claps subcommands
|
||||
#[command(subcommand)]
|
||||
@ -154,7 +154,7 @@ mod tests {
|
||||
format: None,
|
||||
// This is usually replaced in assertion tests
|
||||
password: None,
|
||||
threads: None,
|
||||
concurrency: None,
|
||||
cmd: Subcommand::Decompress {
|
||||
// Put a crazy value here so no test can assert it unintentionally
|
||||
files: vec!["\x00\x11\x22".into()],
|
||||
|
@ -54,7 +54,7 @@ pub fn run(
|
||||
question_policy: QuestionPolicy,
|
||||
file_visibility_policy: FileVisibilityPolicy,
|
||||
) -> crate::Result<()> {
|
||||
if let Some(threads) = args.threads {
|
||||
if let Some(threads) = args.concurrency {
|
||||
rayon::ThreadPoolBuilder::new()
|
||||
.num_threads(threads)
|
||||
.build_global()
|
||||
|
Loading…
x
Reference in New Issue
Block a user