diff --git a/src/chall.rs b/src/chall.rs index afe4684..e1db22b 100644 --- a/src/chall.rs +++ b/src/chall.rs @@ -22,9 +22,8 @@ impl Command for CommandImpl { fn run(&self, _arg_matches: &ArgMatches, sub_arg_matches: &ArgMatches) -> CommandError { let json_output = sub_arg_matches.is_present("json"); - if json_output { - rust_util::util_msg::set_logger_std_out(false); - } + if json_output { rust_util::util_msg::set_logger_std_out(false); } + let sha256_output = sub_arg_matches.is_present("sha256"); let sha384_output = sub_arg_matches.is_present("sha384"); let sha512_output = sub_arg_matches.is_present("sha512"); @@ -32,7 +31,7 @@ impl Command for CommandImpl { if let Some(challenge) = sub_arg_matches.value_of("challenge") { challenge_bytes = challenge.as_bytes().to_vec(); } else if let Some(challenge_hex) = sub_arg_matches.value_of("challenge-hex") { - challenge_bytes = hex::decode(challenge_hex)?; + challenge_bytes = opt_result!(hex::decode(challenge_hex), "Decode challenge hex: {}, failed: {}", challenge_hex); } else { return simple_error!("Challenge must assigned"); }