@@ -53,22 +53,25 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
5353
5454 cmd := & cobra.Command {
5555 Use : "list" ,
56- Short : "List and filter pull requests in this repository" ,
56+ Short : "List pull requests in a repository" ,
57+ Long : heredoc .Doc (`
58+ List pull requests in a GitHub repository.
59+
60+ The search query syntax is documented here:
61+ <https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests>
62+ ` ),
5763 Example : heredoc .Doc (`
5864 List PRs authored by you
5965 $ gh pr list --author "@me"
6066
61- List PRs assigned to you
62- $ gh pr list --assignee "@me"
63-
64- List PRs by label, combining multiple labels with AND
67+ List only PRs with all of the given labels
6568 $ gh pr list --label bug --label "priority 1"
6669
67- List PRs using search syntax
70+ Filter PRs using search syntax
6871 $ gh pr list --search "status:success review:required"
6972
70- Open the list of PRs in a web browser
71- $ gh pr list --web
73+ Find a PR that introduced a given commit
74+ $ gh pr list --search "<SHA>" --state merged
7275 ` ),
7376 Aliases : []string {"ls" },
7477 Args : cmdutil .NoArgsQuoteReminder ,
@@ -99,15 +102,15 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
99102 },
100103 }
101104
102- cmd .Flags ().BoolVarP (& opts .WebMode , "web" , "w" , false , "Open the browser to list the pull requests " )
105+ cmd .Flags ().BoolVarP (& opts .WebMode , "web" , "w" , false , "List pull requests in the web browser " )
103106 cmd .Flags ().IntVarP (& opts .LimitResults , "limit" , "L" , 30 , "Maximum number of items to fetch" )
104107 cmd .Flags ().StringVarP (& opts .State , "state" , "s" , "open" , "Filter by state: {open|closed|merged|all}" )
105108 _ = cmd .RegisterFlagCompletionFunc ("state" , func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
106109 return []string {"open" , "closed" , "merged" , "all" }, cobra .ShellCompDirectiveNoFileComp
107110 })
108111 cmd .Flags ().StringVarP (& opts .BaseBranch , "base" , "B" , "" , "Filter by base branch" )
109112 cmd .Flags ().StringVarP (& opts .HeadBranch , "head" , "H" , "" , "Filter by head branch" )
110- cmd .Flags ().StringSliceVarP (& opts .Labels , "label" , "l" , nil , "Filter by labels " )
113+ cmd .Flags ().StringSliceVarP (& opts .Labels , "label" , "l" , nil , "Filter by label " )
111114 cmd .Flags ().StringVarP (& opts .Author , "author" , "A" , "" , "Filter by author" )
112115 cmd .Flags ().StringVar (& opts .AppAuthor , "app" , "" , "Filter by GitHub App author" )
113116 cmd .Flags ().StringVarP (& opts .Assignee , "assignee" , "a" , "" , "Filter by assignee" )
0 commit comments