diff --git a/command/issue.go b/command/issue.go index 958bcb9bd..cc93c6e81 100644 --- a/command/issue.go +++ b/command/issue.go @@ -108,7 +108,7 @@ func issueList(cmd *cobra.Command, args []string) error { msg := "There are no open issues" userSetFlags := false - cmd.Flags().VisitAll(func(f *pflag.Flag) { + cmd.Flags().Visit(func(f *pflag.Flag) { userSetFlags = f.Changed || userSetFlags }) if userSetFlags { diff --git a/command/pr.go b/command/pr.go index e72b73024..790e27fef 100644 --- a/command/pr.go +++ b/command/pr.go @@ -1,6 +1,7 @@ package command import ( + "errors" "fmt" "io" "os" @@ -45,8 +46,13 @@ A pull request can be supplied as argument in any of the following formats: var prCheckoutCmd = &cobra.Command{ Use: "checkout { | | }", Short: "Check out a pull request in Git", - Args: cobra.MinimumNArgs(1), - RunE: prCheckout, + Args: func(cmd *cobra.Command, args []string) error { + if len(args) < 1 { + return errors.New("requires a PR number as an argument") + } + return nil + }, + RunE: prCheckout, } var prListCmd = &cobra.Command{ Use: "list",