From b4bcaa92ca63b7c71ea5c28d5e9a6af3ecb88a91 Mon Sep 17 00:00:00 2001
From: Awiteb
Date: Mon, 29 Apr 2024 13:39:36 +0200
Subject: [PATCH] feat: Validate args before ask for the master password (#17)
Reviewed-on: https://git.4rs.nl/awiteb/lprs/pulls/17
Fixes: https://git.4rs.nl/awiteb/lprs/issues/13
Co-authored-by: Awiteb
Co-committed-by: Awiteb
---
src/cli/add_command.rs | 23 ++++++++-------
src/cli/clean_command.rs | 4 +--
src/cli/edit_command.rs | 29 ++++++++++---------
src/cli/export_command.rs | 26 +++++++++--------
src/cli/gen_command.rs | 41 ++++++++++++++-------------
src/cli/import_command.rs | 59 ++++++++++++++++++++-------------------
src/cli/list_command.rs | 4 +--
src/cli/mod.rs | 4 ++-
src/cli/remove_command.rs | 4 +--
src/macros.rs | 16 ++++++++---
src/traits.rs | 10 +++++--
11 files changed, 124 insertions(+), 96 deletions(-)
diff --git a/src/cli/add_command.rs b/src/cli/add_command.rs
index ce3c8df..dc7f5ef 100644
--- a/src/cli/add_command.rs
+++ b/src/cli/add_command.rs
@@ -18,7 +18,7 @@ use clap::Args;
use crate::{
vault::{vault_state::*, Vault, Vaults},
- LprsError, LprsResult, RunCommand,
+ LprsCommand, LprsError, LprsResult,
};
#[derive(Debug, Args)]
@@ -31,16 +31,8 @@ pub struct Add {
password: Option