File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import (
1414 "github.com/github/gh-cli/git"
1515 "github.com/github/gh-cli/utils"
1616 "github.com/spf13/cobra"
17+ "github.com/spf13/pflag"
1718)
1819
1920func init () {
@@ -181,8 +182,17 @@ func prList(cmd *cobra.Command, args []string) error {
181182 }
182183
183184 if len (prs ) == 0 {
184- colorOut := colorableOut (cmd )
185- printMessage (colorOut , "There are no open pull requests" )
185+ colorErr := colorableErr (cmd ) // If the user is piping this command we don't want them to process this message as if it were a PR entry
186+ msg := "There are no open pull requests"
187+
188+ userSetFlags := false
189+ cmd .Flags ().VisitAll (func (f * pflag.Flag ) {
190+ userSetFlags = f .Changed || userSetFlags
191+ })
192+ if userSetFlags {
193+ msg = "No pull requests matched your search"
194+ }
195+ printMessage (colorErr , msg )
186196 return nil
187197 }
188198
You can’t perform that action at this time.
0 commit comments