feat(cli/org): org rm/restore/purge trash lifecycle (collection-scoped)

This commit is contained in:
adlee-was-taken
2026-06-20 14:39:18 -04:00
parent 057a7defe5
commit 6123d8b033
4 changed files with 350 additions and 4 deletions

View File

@@ -535,8 +535,12 @@ pub(crate) enum OrgCommands {
#[arg(long)] phone: Option<String>,
#[arg(long)] full_name: Option<String>,
},
// Item subcommands (Rm/Restore/Purge) are added by
// Task B13, which extends this enum.
/// Soft-delete an org item (reversible via `org restore`).
Rm { query: String },
/// Restore a soft-deleted org item.
Restore { query: String },
/// Permanently purge an org item (deletes the encrypted blob).
Purge { query: String },
}
#[derive(clap::Subcommand)]
@@ -689,8 +693,18 @@ fn main() -> Result<()> {
let d = crate::org_session::org_dir(dir_path)?;
commands::org::run_edit(&d, &query, title, username, url, password, body, email, phone, full_name)?;
}
// Item dispatch arms (Rm/Restore/Purge) added by
// Task B13.
OrgCommands::Rm { query } => {
let d = crate::org_session::org_dir(dir_path)?;
commands::org::run_rm(&d, &query)?;
}
OrgCommands::Restore { query } => {
let d = crate::org_session::org_dir(dir_path)?;
commands::org::run_restore(&d, &query)?;
}
OrgCommands::Purge { query } => {
let d = crate::org_session::org_dir(dir_path)?;
commands::org::run_purge(&d, &query)?;
}
}
Ok(())
}