diff --git a/src/cmd_pgpcardsign.rs b/src/cmd_pgpcardsign.rs index 28c92e6..402ae91 100644 --- a/src/cmd_pgpcardsign.rs +++ b/src/cmd_pgpcardsign.rs @@ -48,7 +48,7 @@ impl Command for CommandImpl { .arg(Arg::with_name("use-sha256").long("use-sha256").help("Use SHA256 for file in")) .arg(Arg::with_name("use-sha384").long("use-sha384").help("Use SHA384 for file in")) .arg(Arg::with_name("use-sha512").long("use-sha512").help("Use SHA512 for file in")) - .arg(Arg::with_name("algo").long("algo").help("Algorithm, rsa, ecdsa, eddsa")) + .arg(Arg::with_name("algo").long("algo").takes_value(true).help("Algorithm, rsa, ecdsa, eddsa")) .arg(Arg::with_name("json").long("json").help("JSON output")) } @@ -82,15 +82,21 @@ impl Command for CommandImpl { if use_sha256 { let hash = opt_result!(calc_file_digest::(file_in), "Calc file: {} SHA256 failed: {}", file_in); - sha256 = Some(hex::encode(hash)); + let hash_hex = hex::encode(hash); + information!("File SHA256 hex: {}", &hash_hex); + sha256 = Some(hash_hex); } if use_sha384 { let hash = opt_result!(calc_file_digest::(file_in), "Calc file: {} SHA384 failed: {}", file_in); - sha384 = Some(hex::encode(hash)); + let hash_hex = hex::encode(hash); + information!("File SHA384 hex: {}", &hash_hex); + sha384 = Some(hash_hex); } if use_sha512 { let hash = opt_result!(calc_file_digest::(file_in), "Calc file: {} SHA512 failed: {}", file_in); - sha512 = Some(hex::encode(hash)); + let hash_hex = hex::encode(hash); + information!("File SHA512 hex: {}", &hash_hex); + sha512 = Some(hash_hex); } let mut entry = BTreeMap::new();