Adds deleting logins

Signed-off-by: Ash Svitan <selfsigned-ash@proton.me>
This commit is contained in:
2026-04-30 21:48:05 +02:00
parent 3719b63d73
commit 8313188825
3 changed files with 32 additions and 1 deletions
+12 -1
View File
@@ -25,6 +25,7 @@ pub struct Items {
pub struct Item {
pub id: String,
pub content: ItemContent,
pub state: String,
}
#[derive(Deserialize, Debug, Clone)]
@@ -107,7 +108,9 @@ pub fn get_logins(items: Items) -> Vec<LoginItem> {
.items
.iter()
.filter(|item| {
if let None = item.content.content.login {
if item.state.to_lowercase() != "active" {
false
} else if let None = item.content.content.login {
false
} else {
true
@@ -154,3 +157,11 @@ pub fn create(vault: &String, title: String, user: String, password: String) {
));
println!("> {}", output);
}
pub fn trash(vault: &String, id: String) {
let output = sh::sh(format!(
"{} item trash --vault-name '{}' --item-id '{}'",
EXECUTABLE, vault, id
));
println!("> {}", output);
}