Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Categories Used:
- Make `.bz3` opt-out [\#814](https://github.com/ouch-org/ouch/pull/814) ([amyspark](https://github.com/amyspark))
- fix: adjust INFO color to green [\#858](https://github.com/ouch-org/ouch/pull/858) ([etolbakov](https://github.com/etolbakov))
- Bump zip crate to 6.0.0 [\#872](https://github.com/ouch-org/ouch/pull/872) ([vrmiguel](https://github.com/vrmiguel))
- Add alias `--concurrency` to `--threads` flag (then swap alias with original) [\#848](https://github.com/ouch-org/ouch/pull/848) ([marcospb19](https://github.com/marcospb19))

## [0.6.1](https://github.com/ouch-org/ouch/compare/0.6.0...0.6.1)

Expand Down
8 changes: 4 additions & 4 deletions src/cli/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ pub struct CliArgs {
#[arg(short, long = "password", aliases = ["pass", "pw"], 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)]
Expand Down Expand Up @@ -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()],
Expand Down
2 changes: 1 addition & 1 deletion src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,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()
Expand Down
23 changes: 11 additions & 12 deletions tests/snapshots/ui__ui_test_usage_help_flag-2.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: tests/ui.rs
expression: "output_to_string(ouch!(\"-h\"))"
snapshot_kind: text
---
A command-line utility for easily compressing and decompressing files and directories.

Expand All @@ -14,14 +13,14 @@ Commands:
help Print this message or the help of the given subcommand(s)

Options:
-y, --yes Skip [Y/n] questions, default to yes
-n, --no Skip [Y/n] questions, default to no
-A, --accessible Activate accessibility mode, reducing visual noise [env: ACCESSIBLE=]
-H, --hidden Ignore hidden files
-q, --quiet Silence output
-g, --gitignore Ignore files matched by git's ignore files
-f, --format <FORMAT> Specify the format of the archive
-p, --password <PASSWORD> Decompress or list with password
-c, --threads <THREADS> Concurrent working threads
-h, --help Print help (see more with '--help')
-V, --version Print version
-y, --yes Skip [Y/n] questions, default to yes
-n, --no Skip [Y/n] questions, default to no
-A, --accessible Activate accessibility mode, reducing visual noise [env: ACCESSIBLE=]
-H, --hidden Ignore hidden files
-q, --quiet Silence output
-g, --gitignore Ignore files matched by git's ignore files
-f, --format <FORMAT> Specify the format of the archive
-p, --password <PASSWORD> Decompress or list with password
-c, --concurrency <CONCURRENCY> Limit the amount of concurrent threads available [aliases: threads]
-h, --help Print help (see more with '--help')
-V, --version Print version
7 changes: 4 additions & 3 deletions tests/snapshots/ui__ui_test_usage_help_flag.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: tests/ui.rs
expression: "output_to_string(ouch!(\"--help\"))"
snapshot_kind: text
---
A command-line utility for easily compressing and decompressing files and directories.

Expand Down Expand Up @@ -44,8 +43,10 @@ Options:
-p, --password <PASSWORD>
Decompress or list with password

-c, --threads <THREADS>
Concurrent working threads
-c, --concurrency <CONCURRENCY>
Limit the amount of concurrent threads available

[aliases: threads]

-h, --help
Print help (see a summary with '-h')
Expand Down
Loading