diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-04 13:28:30 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-04 13:28:30 +0000 |
| commit | 3908abbbfc5e748dd168d22bf5e3ea6aae17de61 (patch) | |
| tree | 7d16390d57f8a7399212ebc30e6524ed25da1db6 /src/bin/ngit/main.rs | |
| parent | a554da3ec0bdfef648921fda41f38ad0a5d53d27 (diff) | |
feat: add ngit issue list command
Non-interactive listing of NIP-34 issues (kind 1621) with status
resolution, hashtag display, and detail view.
- get_issues_from_cache: fetch GitIssue events from local cache by repo
coordinate, mirroring get_proposals_and_revisions_from_cache
- ngit issue list: table output of ID, status, title and hashtags at end
of each row; status resolved via existing get_status() logic
- --status: comma-separated filter (open,draft,closed,applied; default: open)
- --hashtag: comma-separated label filter (case-insensitive, OR match)
- --json: machine-readable output including hashtags and description
- --offline: skip network fetch, use local cache only
- <id>: optional positional argument (hex event-id or nevent) to show
full details of a specific issue including body content
Diffstat (limited to 'src/bin/ngit/main.rs')
| -rw-r--r-- | src/bin/ngit/main.rs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/bin/ngit/main.rs b/src/bin/ngit/main.rs index 5a7654a..cb0cc52 100644 --- a/src/bin/ngit/main.rs +++ b/src/bin/ngit/main.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | #![cfg_attr(not(test), warn(clippy::expect_used))] | 3 | #![cfg_attr(not(test), warn(clippy::expect_used))] |
| 4 | 4 | ||
| 5 | use clap::Parser; | 5 | use clap::Parser; |
| 6 | use cli::{AccountCommands, CUSTOMISE_TEMPLATE, Cli, Commands}; | 6 | use cli::{AccountCommands, CUSTOMISE_TEMPLATE, Cli, Commands, IssueCommands}; |
| 7 | 7 | ||
| 8 | mod cli; | 8 | mod cli; |
| 9 | use ngit::{ | 9 | use ngit::{ |
| @@ -58,6 +58,24 @@ async fn main() { | |||
| 58 | id, | 58 | id, |
| 59 | offline, | 59 | offline, |
| 60 | } => sub_commands::list::launch(status.clone(), *json, id.clone(), *offline).await, | 60 | } => sub_commands::list::launch(status.clone(), *json, id.clone(), *offline).await, |
| 61 | Commands::Issue(args) => match &args.issue_command { | ||
| 62 | IssueCommands::List { | ||
| 63 | status, | ||
| 64 | hashtag, | ||
| 65 | json, | ||
| 66 | id, | ||
| 67 | offline, | ||
| 68 | } => { | ||
| 69 | sub_commands::issue_list::launch( | ||
| 70 | status.clone(), | ||
| 71 | hashtag.clone(), | ||
| 72 | *json, | ||
| 73 | id.clone(), | ||
| 74 | *offline, | ||
| 75 | ) | ||
| 76 | .await | ||
| 77 | } | ||
| 78 | }, | ||
| 61 | Commands::Send(args) => sub_commands::send::launch(&cli, args, false).await, | 79 | Commands::Send(args) => sub_commands::send::launch(&cli, args, false).await, |
| 62 | Commands::Sync(args) => sub_commands::sync::launch(args).await, | 80 | Commands::Sync(args) => sub_commands::sync::launch(args).await, |
| 63 | Commands::Checkout { id, offline } => { | 81 | Commands::Checkout { id, offline } => { |