fix(cli/org): reject --file on non-Document org edit (fail fast)

This commit is contained in:
adlee-was-taken
2026-06-20 21:28:52 -04:00
parent 8ec616be5d
commit fe8eeb97c9

View File

@@ -1015,6 +1015,9 @@ pub fn run_edit(dir: &Path, query: &str, totp_qr: Option<std::path::PathBuf>, fi
crate::org_session::UnlockedOrgVault::ensure_grant(&caller, &collection)?;
let mut item = vault.load_item(&collection, &id)?;
if file.is_some() && !matches!(item.core, ItemCore::Document(_)) {
anyhow::bail!("--file is only valid when editing a Document item");
}
eprintln!(
"Editing: {} ({}) — leave a prompt blank to keep the current value.",
item.title,