fix: fixed the `--key` argument not being used
Diff
src/main.rs | 4 +---
src/util.rs | 2 +-
2 files changed, 2 insertions(+), 4 deletions(-)
@@ -7,8 +7,6 @@ mod bwutil;
const SESSION_ENV_KEY: &str = "BW_SESSION";
const BW_FIELD_KEY_FILENAME: &str = "private";
const BW_FIELD_KEY_PASSPHRASE: &str = "passphrase";
@@ -43,7 +41,7 @@ fn main() -> Result<()> {
let mut key_filename = String::new();
let mut key_passphrase = String::new();
for field in fields {
if field.name.to_lowercase().eq(&String::from(BW_FIELD_KEY_FILENAME).to_lowercase()) {
if field.name.to_lowercase().eq(&args.key.to_lowercase()) {
key_filename.push_str(&field.value);
}
if field.name.to_lowercase().eq(&String::from(BW_FIELD_KEY_PASSPHRASE).to_lowercase()) {
@@ -11,7 +11,7 @@ pub struct Cli {
pub debug: bool,
#[options(help = "folder name to use to search for SSH keys", default = "ssh-agent")]
pub folder: String,
#[options(help = "custom field name where the private key is stored", meta = "PRIVATE_KEY", default = "private-key")]
#[options(help = "custom field name where the private key filename is stored", meta = "NAME", default = "private")]
pub key: String,
#[options(help = "custom field name where the key passphrase is stored", meta = "PASS", default = "passphrase")]
pub passphrase: String,