feat: updates
This commit is contained in:
@@ -2,10 +2,10 @@ use std::collections::BTreeMap;
|
||||
|
||||
use clap::{App, Arg, ArgMatches, SubCommand};
|
||||
use openpgp_card::crypto_data::Cryptogram;
|
||||
use rust_util::{util_msg, XResult};
|
||||
use rust_util::XResult;
|
||||
use rust_util::util_clap::{Command, CommandError};
|
||||
|
||||
use crate::{pgpcardutil, pinutil};
|
||||
use crate::{cmdutil, pgpcardutil, pinutil};
|
||||
use crate::util::{base64_encode, read_stdin, try_decode};
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
@@ -36,12 +36,11 @@ impl Command for CommandImpl {
|
||||
.arg(Arg::with_name("ciphertext").short("c").long("ciphertext").takes_value(true).help("Cipher text (HEX or Base64)"))
|
||||
.arg(Arg::with_name("stdin").long("stdin").help("Standard input (Ciphertext)"))
|
||||
.arg(Arg::with_name("algo").long("algo").takes_value(true).help("Algo: RSA, X25519/ECDH"))
|
||||
.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 pin_opt = sub_arg_matches.value_of("pass").or_else(|| sub_arg_matches.value_of("pin"));
|
||||
let pin_opt = pinutil::get_pin(pin_opt);
|
||||
|
||||
Reference in New Issue
Block a user