X Tutup
Skip to content

Commit d1754b2

Browse files
committed
Improve issue/pr/repo view documentation
- Short-form docs for `pr/repo view` no longer say "in browser" - Long-form docs for all these commands now list more information about what will be displayed in the terminal, plus stressing out the alternate behavior with the `--web` flag. - `--web` flag docs: add English articles
1 parent e10ccef commit d1754b2

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

command/issue.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func init() {
3838
issueListCmd.Flags().StringP("author", "A", "", "Filter by author")
3939

4040
issueCmd.AddCommand(issueViewCmd)
41-
issueViewCmd.Flags().BoolP("web", "w", false, "Open issue in browser")
41+
issueViewCmd.Flags().BoolP("web", "w", false, "Open an issue in the browser")
4242
}
4343

4444
var issueCmd = &cobra.Command{
@@ -74,7 +74,10 @@ var issueViewCmd = &cobra.Command{
7474
return nil
7575
},
7676
Short: "View an issue",
77-
RunE: issueView,
77+
Long: `Display the title, body, and other information about an issue.
78+
79+
With '--web', open the issue in a web browser instead.`,
80+
RunE: issueView,
7881
}
7982

8083
func issueList(cmd *cobra.Command, args []string) error {

command/pr.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func init() {
3131
prListCmd.Flags().StringSliceP("label", "l", nil, "Filter by label")
3232
prListCmd.Flags().StringP("assignee", "a", "", "Filter by assignee")
3333

34-
prViewCmd.Flags().BoolP("web", "w", false, "Open pull request in browser")
34+
prViewCmd.Flags().BoolP("web", "w", false, "Open a pull request in the browser")
3535
}
3636

3737
var prCmd = &cobra.Command{
@@ -56,11 +56,13 @@ var prStatusCmd = &cobra.Command{
5656
}
5757
var prViewCmd = &cobra.Command{
5858
Use: "view [{<number> | <url> | <branch>}]",
59-
Short: "View a pull request in the browser",
60-
Long: `View a pull request specified by the argument.
59+
Short: "View a pull request",
60+
Long: `Display the title, body, and other information about a pull request.
6161
62-
Without an argument, the pull request that belongs to the current
63-
branch is displayed.`,
62+
Without an argument, the pull request that belongs to the current branch
63+
is displayed.
64+
65+
With '--web', open the pull request in a web browser instead.`,
6466
RunE: prView,
6567
}
6668

command/repo.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func init() {
3737
repoForkCmd.Flags().Lookup("remote").NoOptDefVal = "true"
3838

3939
repoCmd.AddCommand(repoViewCmd)
40-
repoViewCmd.Flags().BoolP("web", "w", false, "Open repository in browser")
40+
repoViewCmd.Flags().BoolP("web", "w", false, "Open a repository in the browser")
4141
}
4242

4343
var repoCmd = &cobra.Command{
@@ -80,10 +80,12 @@ With no argument, creates a fork of the current repository. Otherwise, forks the
8080

8181
var repoViewCmd = &cobra.Command{
8282
Use: "view [<repository>]",
83-
Short: "View a repository in the browser",
84-
Long: `View a GitHub repository.
83+
Short: "View a repository",
84+
Long: `Display the description and the README of a GitHub repository.
8585
86-
With no argument, the repository for the current directory is displayed.`,
86+
With no argument, the repository for the current directory is displayed.
87+
88+
With '--web', open the repository in a web browser instead.`,
8789
RunE: repoView,
8890
}
8991

0 commit comments

Comments
 (0)
X Tutup