Skip to content

Better error messages and/or infer branch for gh pr close #5789

@BKDaugherty

Description

@BKDaugherty

Describe the bug

A clear and concise description of what the bug is. Include version by typing gh --version.

❯ gh --version
gh version 2.11.3 (2022-05-25)
https://github.com/cli/cli/releases/tag/v2.11.3

Steps to reproduce the behavior

❯ gh pr close -c "Going with a new method! This is no longer necessary"
accepts 1 arg(s), received 0

Expected vs actual behavior

Maybe it was specifically decided that gh pr close wouldn't infer the branch because it's a more spooky command but I found it non-intuitive given that gh pr view and gh pr edit does infer the branch. Either way, it would have been nice to receive a better error message about what accepts 1 arg here.

Easy to get around of course

❯ gh pr close brendon-plot-data-serialize-results -c "Going with a new method! This is no longer necessary" -d
✓ Closed pull request #768 (Add Serialize results support to plot data generation )
✓ Deleted branch brendon-plot-data-serialize-results and switched to branch main

Worked fine, but would be nice for people to not have to run into this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions welcomepriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions