feat(cli/org): org get + list with per-member grant filtering

This commit is contained in:
adlee-was-taken
2026-06-20 14:08:22 -04:00
parent 87b1d166c2
commit 2acd57a4a5
2 changed files with 147 additions and 4 deletions

View File

@@ -512,8 +512,18 @@ pub(crate) enum OrgCommands {
#[command(subcommand)]
kind: OrgAddKind,
},
// Item subcommands (Get/List/Edit/Rm/Restore/Purge) are added by
// Tasks B11B13, which extend this enum.
/// Print an org item (secrets masked unless --show).
Get {
/// Item id or case-insensitive title substring.
query: String,
#[arg(long)] show: bool,
},
/// List org items visible to you (filtered by your collection grants).
List {
#[arg(long)] trashed: bool,
},
// Item subcommands (Edit/Rm/Restore/Purge) are added by
// Tasks B12B13, which extend this enum.
}
#[derive(clap::Subcommand)]
@@ -654,8 +664,16 @@ fn main() -> Result<()> {
};
commands::org::run_add(&d, &collection, add_kind, tags)?;
}
// Item dispatch arms (Get/List/Edit/Rm/Restore/Purge) added by
// Tasks B11B13.
OrgCommands::Get { query, show } => {
let d = crate::org_session::org_dir(dir_path)?;
commands::org::run_get(&d, &query, show)?;
}
OrgCommands::List { trashed } => {
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.
}
Ok(())
}