From 6ddebf574a8bf3a5ffe8ed9651f2b24c8e55c5af Mon Sep 17 00:00:00 2001 From: Dave Teare Date: Sat, 12 Mar 2022 09:44:00 -0500 Subject: [PATCH] Leveraging `op` --cache option --- src/op.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/op.rs b/src/op.rs index 257081e..5592d9e 100644 --- a/src/op.rs +++ b/src/op.rs @@ -109,6 +109,7 @@ pub fn load_all_accounts(account_user_uuids: &Vec) -> Result) -> Result, Error> { let output = Command::new("op") + .arg("--cache") .arg("--format") .arg("json") .arg("account") @@ -161,6 +162,7 @@ pub fn find_accounts(account_user_uuids: &Vec) -> Result Result { let output = Command::new("op") + .arg("--cache") .arg("--account") .arg(user_id) .arg("--format") @@ -184,6 +186,7 @@ pub fn get_account(user_id: &String) -> Result { // op --format json --account A vault list | op --format json --account A vault get --format json - pub fn load_all_vaults(account_id: &String) -> Result, Error> { let output = Command::new("op") + .arg("--cache") .arg("--format") .arg("json") .arg("--account") @@ -202,6 +205,7 @@ pub fn load_all_vaults(account_id: &String) -> Result, Error> } let mut vault_details_cmd = Command::new("op") + .arg("--cache") .arg("--format") .arg("json") .arg("--account") @@ -254,6 +258,7 @@ pub fn load_all_vaults(account_id: &String) -> Result, Error> #[allow(dead_code)] pub fn find_vaults(account_id: &String) -> Result, Error> { let output = Command::new("op") + .arg("--cache") .arg("--format") .arg("json") .arg("--account") @@ -278,6 +283,7 @@ pub fn find_vaults(account_id: &String) -> Result, Error> { #[allow(dead_code)] pub fn get_vault(account_id: &String, vault_id: &String) -> Result { let output = Command::new("op") + .arg("--cache") .arg("--format") .arg("json") .arg("--account") @@ -302,6 +308,7 @@ pub fn get_vault(account_id: &String, vault_id: &String) -> Result Result, Error> { let list_output = Command::new("op") + .arg("--cache") .arg("--format") .arg("json") .arg("--account") @@ -322,6 +329,7 @@ pub fn load_all_items(account_id: &String, vault_id: &String) -> Result Result Result, Error> { let output = Command::new("op") + .arg("--cache") .arg("--format") .arg("json") .arg("--account") @@ -406,6 +415,7 @@ pub fn get_item( item_id: &String, ) -> Result { let output = Command::new("op") + .arg("--cache") .arg("--account") .arg(account_id) .arg("--vault")