diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-05 12:02:09 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-05 12:08:56 +0000 |
| commit | b0ad2fd720d0cd335c07f22767844f571e3306ff (patch) | |
| tree | daed4f00be5edb09ba108dc40d66555053a39a73 /src/bin/ngit/cli.rs | |
| parent | 3ac5395b47c709c00f0072668dfdceb04f2d4974 (diff) | |
feat(status): add pr draft, issue resolved, and --reason for issue close
Add `ngit pr draft <id>` to convert a PR back to draft (kind-1632).
Add `ngit issue resolved <id> [--reason <text>]` to mark an issue as
fixed (kind-1631 GitStatusApplied), distinct from close which signals
wontfix/duplicate/invalid.
Add `--reason <text>` to `ngit issue close` — stored in event content.
Also fix success/error message wording in pr_status and issue_status to
use consistent past-tense action strings.
Diffstat (limited to 'src/bin/ngit/cli.rs')
| -rw-r--r-- | src/bin/ngit/cli.rs | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/bin/ngit/cli.rs b/src/bin/ngit/cli.rs index b9b274e..37d85a2 100644 --- a/src/bin/ngit/cli.rs +++ b/src/bin/ngit/cli.rs | |||
| @@ -270,6 +270,15 @@ pub enum PrCommands { | |||
| 270 | #[arg(long)] | 270 | #[arg(long)] |
| 271 | offline: bool, | 271 | offline: bool, |
| 272 | }, | 272 | }, |
| 273 | /// convert a PR back to draft (author or maintainer only) | ||
| 274 | Draft { | ||
| 275 | /// Proposal event-id (hex) or nevent (bech32) | ||
| 276 | #[arg(value_name = "ID|nevent")] | ||
| 277 | id: String, | ||
| 278 | /// Use local cache only, skip network fetch | ||
| 279 | #[arg(long)] | ||
| 280 | offline: bool, | ||
| 281 | }, | ||
| 273 | /// add a comment to a PR | 282 | /// add a comment to a PR |
| 274 | Comment { | 283 | Comment { |
| 275 | /// Proposal event-id (hex) or nevent (bech32) | 284 | /// Proposal event-id (hex) or nevent (bech32) |
| @@ -373,11 +382,29 @@ pub enum IssueCommands { | |||
| 373 | #[arg(long = "label", value_name = "LABEL")] | 382 | #[arg(long = "label", value_name = "LABEL")] |
| 374 | labels: Vec<String>, | 383 | labels: Vec<String>, |
| 375 | }, | 384 | }, |
| 376 | /// close an issue (author or maintainer only) | 385 | /// close an issue without resolving it (author or maintainer only) |
| 377 | Close { | 386 | Close { |
| 378 | /// Issue event-id (hex) or nevent (bech32) | 387 | /// Issue event-id (hex) or nevent (bech32) |
| 379 | #[arg(value_name = "ID|nevent")] | 388 | #[arg(value_name = "ID|nevent")] |
| 380 | id: String, | 389 | id: String, |
| 390 | /// Optional reason (e.g. wontfix, duplicate, invalid) | ||
| 391 | #[arg(long)] | ||
| 392 | reason: Option<String>, | ||
| 393 | /// Use local cache only, skip network fetch | ||
| 394 | #[arg(long)] | ||
| 395 | offline: bool, | ||
| 396 | }, | ||
| 397 | /// mark an issue as resolved (author or maintainer only) | ||
| 398 | #[command( | ||
| 399 | long_about = "mark an issue as resolved (author or maintainer only)\n\nuse this when the issue has been fixed or addressed, as distinct from closing without resolution" | ||
| 400 | )] | ||
| 401 | Resolved { | ||
| 402 | /// Issue event-id (hex) or nevent (bech32) | ||
| 403 | #[arg(value_name = "ID|nevent")] | ||
| 404 | id: String, | ||
| 405 | /// Optional reason or resolution summary | ||
| 406 | #[arg(long)] | ||
| 407 | reason: Option<String>, | ||
| 381 | /// Use local cache only, skip network fetch | 408 | /// Use local cache only, skip network fetch |
| 382 | #[arg(long)] | 409 | #[arg(long)] |
| 383 | offline: bool, | 410 | offline: bool, |