Conversation
| return nil | ||
| } | ||
|
|
||
| func prView(cmd *cobra.Command, args []string) error { |
There was a problem hiding this comment.
So there is no name collision in the command package, I started naming these functions as command + subcommand (prView and prList)
| if prNumber, err := strconv.Atoi(args[0]); err == nil { | ||
| openURL = project.WebURL("", "", fmt.Sprintf("pull/%d", prNumber)) | ||
| } else { | ||
| return fmt.Errorf("invalid pull request number: '%s'", args[0]) |
There was a problem hiding this comment.
Opening via branch name is another option to consider here.
There was a problem hiding this comment.
Works well, but I noticed that gh pr view, gh pr view 24 and gh pr view 23 all resulted in the same output, when I was on the corresponding branch for 24. I was assuming that if the pr was still open I could see it show up with this command.
➜ gh-cli git:(add-pr-show) gh pr view 23
? PRs you might be interested in [24] Add `gh pr view`
mislav
left a comment
There was a problem hiding this comment.
Heads up: might have accidentally checked in gh-cli
| return nil | ||
| } | ||
|
|
||
| func prView(cmd *cobra.Command, args []string) error { |
Co-Authored-By: Mislav Marohnić <mislav@github.com>
|
@tierninho Did |
|
@probablycorey I got a mixed bag of results regarding the output of The browser part worked fine for whatever option was presented. When on When on the branch associated with PR 23: When on the branch associated with PR 24: |
|
@tierninho weird! I don't see any output when I run the command It looks like your version is also running the interactive |
|
Hmm, not sure. I just ran these commands and it worked perfectly: |
gh pr view [pr-number]Opens the PR in the browser. If no pr-number is given it opens the PR of the current branch. I want to add tests to this as well, but the
testPR hasn't been merged yet, so I'm waiting for that.