feat(cli/org): org edit — flag-driven field update for login/note/identity

This commit is contained in:
adlee-was-taken
2026-06-20 14:12:46 -04:00
parent 2acd57a4a5
commit 057a7defe5
3 changed files with 122 additions and 4 deletions

View File

@@ -522,8 +522,21 @@ pub(crate) enum OrgCommands {
List {
#[arg(long)] trashed: bool,
},
// Item subcommands (Edit/Rm/Restore/Purge) are added by
// Tasks B12B13, which extend this enum.
/// Edit an org item's fields (flag-driven; blank flags keep current values).
Edit {
/// Item id or case-insensitive title substring.
query: String,
#[arg(long)] title: Option<String>,
#[arg(long)] username: Option<String>,
#[arg(long)] url: Option<String>,
#[arg(long)] password: Option<String>,
#[arg(long)] body: Option<String>,
#[arg(long)] email: Option<String>,
#[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.
}
#[derive(clap::Subcommand)]
@@ -672,8 +685,12 @@ fn main() -> Result<()> {
let d = crate::org_session::org_dir(dir_path)?;
commands::org::run_list(&d, trashed)?;
}
// Item dispatch arms (Edit/Rm/Restore/Purge) added by
// Tasks B12B13.
OrgCommands::Edit { query, title, username, url, password, body, email, phone, full_name } => {
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.
}
Ok(())
}