hive-forge: add 'reopen' verb (pr reopen / issue reopen)
hive-forge had close but no reopen, so reopening required the non-obvious workaround 'issue edit <n> --state open'. Add a reopen verb mirroring close (PATCH state=open), wired into both 'pr reopen' (kind-checked PR) and 'issue reopen' (kind-checked issue). Updates docs/forge.md + the subcommand enumerations.
This commit is contained in:
parent
efb34ef677
commit
11fb2ac0fc
6 changed files with 50 additions and 5 deletions
|
|
@ -1,7 +1,7 @@
|
|||
//! `pr <verb>` — PR-scoped sub-commands. Wraps the per-verb modules under a
|
||||
//! `pr` parent so `hive-forge pr close 42`, `pr status --pr 42`, etc. read as
|
||||
//! kind-namespaced commands. The generic verbs that also work on issues
|
||||
//! (view/comment/comments/close/labels/assign/timeline) kind-check the number
|
||||
//! (view/comment/comments/close/reopen/labels/assign/timeline) kind-check the number
|
||||
//! is a PR first (`assert_kind`); the PR-only verbs hit `/pulls/…` and are
|
||||
//! kind-correct by construction. The flat `pr-*` + bare generic verbs stay as
|
||||
//! hidden back-compat aliases (see `main.rs`).
|
||||
|
|
@ -42,6 +42,8 @@ enum Cmd {
|
|||
Comments(verbs::comments::Args),
|
||||
/// Close the PR.
|
||||
Close(verbs::close::Args),
|
||||
/// Reopen a closed PR.
|
||||
Reopen(verbs::reopen::Args),
|
||||
/// List / add / remove labels.
|
||||
Labels(verbs::labels::Args),
|
||||
/// Assign or unassign a user.
|
||||
|
|
@ -77,6 +79,10 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
|
|||
assert_kind(client, a.number, Kind::Pr)?;
|
||||
verbs::close::run(client, a)
|
||||
}
|
||||
Cmd::Reopen(a) => {
|
||||
assert_kind(client, a.number, Kind::Pr)?;
|
||||
verbs::reopen::run(client, a)
|
||||
}
|
||||
Cmd::Labels(a) => {
|
||||
assert_kind(client, a.number, Kind::Pr)?;
|
||||
verbs::labels::run(client, a)
|
||||
|
|
|
|||
Loading…
Reference in a new issue