diff options
Diffstat (limited to 'src/bin/ngit/cli.rs')
| -rw-r--r-- | src/bin/ngit/cli.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/bin/ngit/cli.rs b/src/bin/ngit/cli.rs index 68b18a7..c2364e6 100644 --- a/src/bin/ngit/cli.rs +++ b/src/bin/ngit/cli.rs | |||
| @@ -134,6 +134,8 @@ pub enum Commands { | |||
| 134 | #[arg(long)] | 134 | #[arg(long)] |
| 135 | offline: bool, | 135 | offline: bool, |
| 136 | }, | 136 | }, |
| 137 | /// list issues | ||
| 138 | Issue(IssueSubCommandArgs), | ||
| 137 | /// checkout a proposal branch by event-id or nevent | 139 | /// checkout a proposal branch by event-id or nevent |
| 138 | #[command( | 140 | #[command( |
| 139 | long_about = "checkout a proposal branch by event-id or nevent\n\nuse `ngit list` to find proposal IDs" | 141 | long_about = "checkout a proposal branch by event-id or nevent\n\nuse `ngit list` to find proposal IDs" |
| @@ -195,6 +197,34 @@ pub struct RepoSubCommandArgs { | |||
| 195 | pub offline: bool, | 197 | pub offline: bool, |
| 196 | } | 198 | } |
| 197 | 199 | ||
| 200 | #[derive(clap::Parser)] | ||
| 201 | pub struct IssueSubCommandArgs { | ||
| 202 | #[command(subcommand)] | ||
| 203 | pub issue_command: IssueCommands, | ||
| 204 | } | ||
| 205 | |||
| 206 | #[derive(Subcommand)] | ||
| 207 | pub enum IssueCommands { | ||
| 208 | /// list issues and their statuses | ||
| 209 | List { | ||
| 210 | /// Filter by status (comma-separated: open,draft,closed,applied) | ||
| 211 | #[arg(long, default_value = "open")] | ||
| 212 | status: String, | ||
| 213 | /// Filter by hashtag/label (comma-separated) | ||
| 214 | #[arg(long)] | ||
| 215 | hashtag: Option<String>, | ||
| 216 | /// Output as JSON | ||
| 217 | #[arg(long)] | ||
| 218 | json: bool, | ||
| 219 | /// Show details for a specific issue (event-id or nevent) | ||
| 220 | #[arg(value_name = "ID|nevent")] | ||
| 221 | id: Option<String>, | ||
| 222 | /// Use local cache only, skip network fetch | ||
| 223 | #[arg(long)] | ||
| 224 | offline: bool, | ||
| 225 | }, | ||
| 226 | } | ||
| 227 | |||
| 198 | #[derive(Subcommand)] | 228 | #[derive(Subcommand)] |
| 199 | pub enum RepoCommands { | 229 | pub enum RepoCommands { |
| 200 | /// publish a repository to nostr (alias for `ngit init`) | 230 | /// publish a repository to nostr (alias for `ngit init`) |