aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 088c86f..ada94fc 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -218,14 +218,17 @@ async fn main() -> Result<()> {
let existing_password = rpassword::prompt_password("Enter password to delete: ")?;
- let keys = CryptoKeys::open(&creds, &user_secrets, &existing_password).await?;
- keys.delete_password(&creds, &existing_password, allow_delete_all)
- .await?;
+ let keys = match allow_delete_all {
+ true => Some(CryptoKeys::open(&creds, &user_secrets, &existing_password).await?),
+ false => None,
+ };
+
+ CryptoKeys::delete_password(&creds, &existing_password, allow_delete_all).await?;
println!("");
println!("Password was deleted successfully.");
- if allow_delete_all {
+ if let Some(keys) = keys {
println!("As a reminder, here are your cryptographic keys:");
dump_keys(&keys);
}