Merge 8227082ac55108ee743280ddce1b74267c605f67 into bbce74666682aa26f62fe0cc980b196257f846fb

This commit is contained in:
João Marcos 2025-07-15 17:02:11 -03:00 committed by GitHub
commit 1e132cb0d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 21 additions and 20 deletions

View File

@ -41,6 +41,7 @@ Categories Used:
### Tweaks ### Tweaks
- Make `.bz3` opt-out [\#814](https://github.com/ouch-org/ouch/pull/814) ([amyspark](https://github.com/amyspark)) - Make `.bz3` opt-out [\#814](https://github.com/ouch-org/ouch/pull/814) ([amyspark](https://github.com/amyspark))
- 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) ## [0.6.1](https://github.com/ouch-org/ouch/compare/0.6.0...0.6.1)

View File

@ -45,9 +45,9 @@ pub struct CliArgs {
#[arg(short, long = "password", aliases = ["pass", "pw"], global = true)] #[arg(short, long = "password", aliases = ["pass", "pw"], 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()],

View File

@ -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()

View File

@ -1,7 +1,6 @@
--- ---
source: tests/ui.rs source: tests/ui.rs
expression: "output_to_string(ouch!(\"-h\"))" expression: "output_to_string(ouch!(\"-h\"))"
snapshot_kind: text
--- ---
A command-line utility for easily compressing and decompressing files and directories. A command-line utility for easily compressing and decompressing files and directories.
@ -22,6 +21,6 @@ Options:
-g, --gitignore Ignore files matched by git's ignore files -g, --gitignore Ignore files matched by git's ignore files
-f, --format <FORMAT> Specify the format of the archive -f, --format <FORMAT> Specify the format of the archive
-p, --password <PASSWORD> Decompress or list with password -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 more with '--help') -h, --help Print help (see more with '--help')
-V, --version Print version -V, --version Print version

View File

@ -1,7 +1,6 @@
--- ---
source: tests/ui.rs source: tests/ui.rs
expression: "output_to_string(ouch!(\"--help\"))" expression: "output_to_string(ouch!(\"--help\"))"
snapshot_kind: text
--- ---
A command-line utility for easily compressing and decompressing files and directories. A command-line utility for easily compressing and decompressing files and directories.
@ -44,8 +43,10 @@ Options:
-p, --password <PASSWORD> -p, --password <PASSWORD>
Decompress or list with password Decompress or list with password
-c, --threads <THREADS> -c, --concurrency <CONCURRENCY>
Concurrent working threads Limit the amount of concurrent threads available
[aliases: threads]
-h, --help -h, --help
Print help (see a summary with '-h') Print help (see a summary with '-h')