feat: v0.3.1

This commit is contained in:
2023-08-13 21:39:31 +08:00
parent b5e13dc13a
commit 56f6ccd777
4 changed files with 16 additions and 8 deletions

View File

@@ -27,10 +27,10 @@ impl Command for CommandImpl {
.arg(Arg::with_name("decrypt").long("decrypt").help("Decrypt text"))
.arg(Arg::with_name("read").long("read").help("Read value"))
.arg(Arg::with_name("write").long("write").help("Write value"))
.arg(Arg::with_name("value").long("value").takes_value(true).help("Value, for encrypt or decrypt"))
.arg(Arg::with_name("key").long("key").takes_value(true).help("Read/Write key name"))
.arg(Arg::with_name("value-hex").long("value-hex").takes_value(true).help("Value(hex), for encrypt"))
.arg(Arg::with_name("value-base64").long("value-base64").takes_value(true).help("Value(base64), for encrypt"))
.arg(Arg::with_name("name").long("name").short("n").takes_value(true).help("Read/Write key name"))
.arg(Arg::with_name("value").long("value").short("v").takes_value(true).help("Value, for encrypt or decrypt"))
.arg(Arg::with_name("value-hex").long("value-hex").short("x").takes_value(true).help("Value(hex), for encrypt"))
.arg(Arg::with_name("value-base64").long("value-base64").short("b").takes_value(true).help("Value(base64), for encrypt"))
.arg(Arg::with_name("yubikey-challenge").long("yubikey-challenge").short("c").takes_value(true).help("Yubikey challenge"))
.arg(Arg::with_name("force-write").long("force-write").short("F").help("Force write value"))
}
@@ -131,8 +131,8 @@ async fn do_init(_arg_matches: &ArgMatches<'_>, sub_arg_matches: &ArgMatches<'_>
}
async fn do_read(_arg_matches: &ArgMatches<'_>, sub_arg_matches: &ArgMatches<'_>) -> CommandError {
let body = if let Some(key) = sub_arg_matches.value_of("key") {
json!({ "name": key })
let body = if let Some(name) = sub_arg_matches.value_of("name") {
json!({ "name": name })
} else {
return simple_error!("Require key");
};