Add `anvil pr edit` command to update PR title/body #3
Links
No links yet.
Problem
There is no way to edit a pull request’s title or body from the CLI after it has been created. anvil pr exposes list, view, create, close, reopen, merge, review, reviews, and comment — but no edit.
This matters whenever the title or description needs revision after the PR is opened (typos, reworded scope, updated checklist, added `Closes #N` links, etc.). Today the only workarounds are the web UI or a hand-rolled `curl PATCH`.
Proposal
Add `anvil pr edit` mirroring the existing `anvil issue edit` command:
``` anvil pr edit [–repo <ORG/REPO>] [–title ] [–body ] ```
- Issues a `PATCH /{org}/{name}/pulls/{number}` with whichever of `title` / `body` are provided.
- If neither flag is given, print a warning (same behavior as `anvil issue edit`).
Scope
The server’s `PullRequest.update_changeset/2` (anvil repo: `lib/anvil/code_review/pull_request.ex:92`) only casts `:title` and `:body`. Base branch, head branch, and labels are not editable via the existing PATCH endpoint, so they are out of scope for this ticket. Broader editability would require a separate server-side change.
Acceptance Criteria
- `anvil pr edit –title "…"` updates the PR title.
- `anvil pr edit –body "…"` updates the PR body.
- Both flags may be combined in a single invocation.
- `anvil pr edit ` with no flags prints a warning and makes no API call.
- `anvil pr –help` lists the new `edit` subcommand.