Better messaging for gh pr checkout
This commit is contained in:
parent
5949ca4b56
commit
5296f72189
2 changed files with 9 additions and 3 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {<number> | <url> | <branch>}",
|
||||
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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue