diff --git a/pkg/cmd/auth/login/login.go b/pkg/cmd/auth/login/login.go index 848b33e0c..b0d0e02cf 100644 --- a/pkg/cmd/auth/login/login.go +++ b/pkg/cmd/auth/login/login.go @@ -187,13 +187,11 @@ func loginRun(opts *LoginOptions) error { } func promptForHostname(opts *LoginOptions) (string, error) { + options := []string{"GitHub.com", "GitHub Enterprise Server"} hostType, err := opts.Prompter.Select( "What account do you want to log into?", - "", - []string{ - "GitHub.com", - "GitHub Enterprise Server", - }) + options[0], + options) if err != nil { return "", err } diff --git a/pkg/cmd/auth/shared/login_flow.go b/pkg/cmd/auth/shared/login_flow.go index 10a371872..16386c20c 100644 --- a/pkg/cmd/auth/shared/login_flow.go +++ b/pkg/cmd/auth/shared/login_flow.go @@ -53,7 +53,8 @@ func Login(opts *LoginOptions) error { } result, err := opts.Prompter.Select( "What is your preferred protocol for Git operations?", - "", options) + options[0], + options) if err != nil { return err } @@ -82,7 +83,8 @@ func Login(opts *LoginOptions) error { if len(pubKeys) > 0 { options := append(pubKeys, "Skip") keyChoice, err := opts.Prompter.Select( - "Upload your SSH public key to your GitHub account?", "", + "Upload your SSH public key to your GitHub account?", + options[0], options) if err != nil { return err @@ -126,12 +128,12 @@ func Login(opts *LoginOptions) error { if opts.Web { authMode = 0 } else if opts.Interactive { + options := []string{"Login with a web browser", "Paste an authentication token"} var err error authMode, err = opts.Prompter.Select( - "How would you like to authenticate GitHub CLI?", "", - []string{ - "Login with a web browser", - "Paste an authentication token"}) + "How would you like to authenticate GitHub CLI?", + options[0], + options) if err != nil { return err } diff --git a/pkg/cmd/extension/command.go b/pkg/cmd/extension/command.go index f8ca82ceb..b19b80b55 100644 --- a/pkg/cmd/extension/command.go +++ b/pkg/cmd/extension/command.go @@ -247,11 +247,10 @@ func NewCmdExtension(f *cmdutil.Factory) *cobra.Command { if err != nil { return extName, -1, err } - extTmplType, err := prompter.Select("What kind of extension?", "", []string{ - "Script (Bash, Ruby, Python, etc)", - "Go", - "Other Precompiled (C++, Rust, etc)", - }) + options := []string{"Script (Bash, Ruby, Python, etc)", "Go", "Other Precompiled (C++, Rust, etc)"} + extTmplType, err := prompter.Select("What kind of extension?", + options[0], + options) return extName, extensions.ExtTemplateType(extTmplType), err } var flagType string diff --git a/pkg/cmd/pr/review/review.go b/pkg/cmd/pr/review/review.go index 0d65cffa2..1383b1d07 100644 --- a/pkg/cmd/pr/review/review.go +++ b/pkg/cmd/pr/review/review.go @@ -205,9 +205,11 @@ func reviewRun(opts *ReviewOptions) error { } func reviewSurvey(opts *ReviewOptions, editorCommand string) (*api.PullRequestReviewInput, error) { + options := []string{"Comment", "Approve", "Request Changes"} reviewType, err := opts.Prompter.Select( - "What kind of review do you want to give?", "", - []string{"Comment", "Approve", "Request Changes"}) + "What kind of review do you want to give?", + options[0], + options) if err != nil { return nil, err }