feat: updates
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
||||
use rust_util::util_clap::{Command, CommandError};
|
||||
use rust_util::util_msg;
|
||||
|
||||
use crate::hmacutil;
|
||||
use crate::{cmdutil, hmacutil};
|
||||
|
||||
pub struct CommandImpl;
|
||||
|
||||
@@ -17,12 +16,11 @@ impl Command for CommandImpl {
|
||||
.arg(Arg::with_name("sha256").short("2").long("sha256").help("Output SHA256"))
|
||||
.arg(Arg::with_name("sha384").short("3").long("sha384").help("Output SHA384"))
|
||||
.arg(Arg::with_name("sha512").short("5").long("sha512").help("Output SHA512"))
|
||||
.arg(Arg::with_name("json").long("json").help("JSON output"))
|
||||
.arg(cmdutil::build_json_arg())
|
||||
}
|
||||
|
||||
fn run(&self, _arg_matches: &ArgMatches, sub_arg_matches: &ArgMatches) -> CommandError {
|
||||
let json_output = sub_arg_matches.is_present("json");
|
||||
if json_output { util_msg::set_logger_std_out(false); }
|
||||
let json_output = cmdutil::check_json_output(sub_arg_matches);
|
||||
|
||||
let challenge_bytes = hmacutil::get_challenge_bytes(sub_arg_matches)?;
|
||||
let hmac_result = hmacutil::compute_yubikey_hmac(&challenge_bytes)?;
|
||||
|
||||
Reference in New Issue
Block a user