diff --git a/man/picca.1.md b/man/picca.1.md index f0c47e4..b863b1f 100644 --- a/man/picca.1.md +++ b/man/picca.1.md @@ -43,6 +43,9 @@ With no FILE(s) specified, or when FILE is a dash (-), picca will read from stan **-t, ––threads**=_THREADS_ : Use at most, at any given time, this number of threads. By default, picca will detect the amount of processors on the system and use that as the thread count. Using 0 for this value results in the default behavior; this is the same as omitting this option. +**-V, ––version** +: Show the version of picca and exit + The following option is only useful when verifying checksums with the **-c** flag: **-q, ––quiet** diff --git a/src/main.rs b/src/main.rs index 0ea7ecc..d61e180 100644 --- a/src/main.rs +++ b/src/main.rs @@ -92,19 +92,7 @@ struct Args { long, help = "Specify an algorithm for hashing", default_value = "sha256", - value_parser = { - let mut combined: Vec<&str> = vec![]; - for i in ALGORITHMS { - combined.push(i); - } - - for i in UNSECURE_ALGORITHMS { - combined.push(i); - } - combined.sort(); - - clap::builder::PossibleValuesParser::new(Vec::from(combined)) - } + value_parser = clap::builder::PossibleValuesParser::new(get_algorithms()) )] algorithm: String, @@ -144,6 +132,20 @@ struct ThreadInfo { hash_errors: Arc, } +fn get_algorithms() -> Vec<&'static str> { + let mut combined: Vec<&str> = vec![]; + for i in ALGORITHMS { + combined.push(i); + } + + for i in UNSECURE_ALGORITHMS { + combined.push(i); + } + combined.sort(); + + return Vec::from(combined) +} + fn hash(info: ThreadInfo) -> Result<(), String> { loop { let mut stdin = None;