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