feat(cli/org): org document edit via --file + purge removes attachments

This commit is contained in:
adlee-was-taken
2026-06-20 21:23:46 -04:00
parent bd323d8b1b
commit 8ec616be5d
3 changed files with 49 additions and 13 deletions

View File

@@ -541,6 +541,8 @@ pub(crate) enum OrgCommands {
query: String,
/// Replace the login TOTP secret from a QR image.
#[arg(long)] totp_qr: Option<std::path::PathBuf>,
/// Replace a Document item's attachment file.
#[arg(long)] file: Option<std::path::PathBuf>,
},
/// Soft-delete an org item (reversible via `org restore`).
Rm { query: String },
@@ -760,9 +762,9 @@ fn main() -> Result<()> {
let d = crate::org_session::org_dir(dir_path)?;
commands::org::run_list(&d, trashed)?;
}
OrgCommands::Edit { query, totp_qr } => {
OrgCommands::Edit { query, totp_qr, file } => {
let d = crate::org_session::org_dir(dir_path)?;
commands::org::run_edit(&d, &query, totp_qr)?;
commands::org::run_edit(&d, &query, totp_qr, file)?;
}
OrgCommands::Rm { query } => {
let d = crate::org_session::org_dir(dir_path)?;