Skip to content

Commit a12cbe7

Browse files
author
Nate Smith
authored
Merge pull request cli#3412 from cristiand391/current-branch-help-text
Add note about current branch detection
2 parents cadabb4 + 8a0d5b0 commit a12cbe7

File tree

6 files changed

+41
-3
lines changed

6 files changed

+41
-3
lines changed

pkg/cmd/pr/checks/checks.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"sort"
88
"time"
99

10+
"github.com/MakeNowJust/heredoc"
1011
"github.com/cli/cli/api"
1112
"github.com/cli/cli/context"
1213
"github.com/cli/cli/internal/ghrepo"
@@ -47,7 +48,13 @@ func NewCmdChecks(f *cmdutil.Factory, runF func(*ChecksOptions) error) *cobra.Co
4748
cmd := &cobra.Command{
4849
Use: "checks [<number> | <url> | <branch>]",
4950
Short: "Show CI status for a single pull request",
50-
Args: cobra.MaximumNArgs(1),
51+
Long: heredoc.Doc(`
52+
Show CI status for a single pull request.
53+
54+
Without an argument, the pull request that belongs to the current branch
55+
is selected.
56+
`),
57+
Args: cobra.MaximumNArgs(1),
5158
RunE: func(cmd *cobra.Command, args []string) error {
5259
// support `-R, --repo` override
5360
opts.BaseRepo = f.BaseRepo

pkg/cmd/pr/comment/comment.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ func NewCmdComment(f *cmdutil.Factory, runF func(*shared.CommentableOptions) err
2828
cmd := &cobra.Command{
2929
Use: "comment [<number> | <url> | <branch>]",
3030
Short: "Create a new pr comment",
31+
Long: heredoc.Doc(`
32+
Create a new pr comment.
33+
34+
Without an argument, the pull request that belongs to the current branch
35+
is selected.
36+
37+
With '--web', comment on the pull request in a web browser instead.
38+
`),
3139
Example: heredoc.Doc(`
3240
$ gh pr comment 22 --body "This looks great, lets get it deployed."
3341
`),

pkg/cmd/pr/diff/diff.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"strings"
1010
"syscall"
1111

12+
"github.com/MakeNowJust/heredoc"
1213
"github.com/cli/cli/api"
1314
"github.com/cli/cli/context"
1415
"github.com/cli/cli/internal/ghrepo"
@@ -40,7 +41,13 @@ func NewCmdDiff(f *cmdutil.Factory, runF func(*DiffOptions) error) *cobra.Comman
4041
cmd := &cobra.Command{
4142
Use: "diff [<number> | <url> | <branch>]",
4243
Short: "View changes in a pull request",
43-
Args: cobra.MaximumNArgs(1),
44+
Long: heredoc.Doc(`
45+
View changes in a pull request.
46+
47+
Without an argument, the pull request that belongs to the current branch
48+
is selected.
49+
`),
50+
Args: cobra.MaximumNArgs(1),
4451
RunE: func(cmd *cobra.Command, args []string) error {
4552
// support `-R, --repo` override
4653
opts.BaseRepo = f.BaseRepo

pkg/cmd/pr/edit/edit.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ func NewCmdEdit(f *cmdutil.Factory, runF func(*EditOptions) error) *cobra.Comman
5050
cmd := &cobra.Command{
5151
Use: "edit [<number> | <url> | <branch>]",
5252
Short: "Edit a pull request",
53+
Long: heredoc.Doc(`
54+
Edit a pull request.
55+
56+
Without an argument, the pull request that belongs to the current branch
57+
is selected.
58+
`),
5359
Example: heredoc.Doc(`
5460
$ gh pr edit 23 --title "I found a bug" --body "Nothing works"
5561
$ gh pr edit 23 --add-label "bug,help wanted" --remove-label "core"

pkg/cmd/pr/merge/merge.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ func NewCmdMerge(f *cmdutil.Factory, runF func(*MergeOptions) error) *cobra.Comm
7070
Short: "Merge a pull request",
7171
Long: heredoc.Doc(`
7272
Merge a pull request on GitHub.
73+
74+
Without an argument, the pull request that belongs to the current branch
75+
is selected.
7376
`),
7477
Args: cobra.MaximumNArgs(1),
7578
RunE: func(cmd *cobra.Command, args []string) error {

pkg/cmd/pr/ready/ready.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"net/http"
77

8+
"github.com/MakeNowJust/heredoc"
89
"github.com/cli/cli/api"
910
"github.com/cli/cli/context"
1011
"github.com/cli/cli/internal/config"
@@ -38,7 +39,13 @@ func NewCmdReady(f *cmdutil.Factory, runF func(*ReadyOptions) error) *cobra.Comm
3839
cmd := &cobra.Command{
3940
Use: "ready [<number> | <url> | <branch>]",
4041
Short: "Mark a pull request as ready for review",
41-
Args: cobra.MaximumNArgs(1),
42+
Long: heredoc.Doc(`
43+
Mark a pull request as ready for review
44+
45+
Without an argument, the pull request that belongs to the current branch
46+
is displayed.
47+
`),
48+
Args: cobra.MaximumNArgs(1),
4249
RunE: func(cmd *cobra.Command, args []string) error {
4350
// support `-R, --repo` override
4451
opts.BaseRepo = f.BaseRepo

0 commit comments

Comments
 (0)