MCPcopy
hub / github.com/cli/cli / promptForHostname

Function promptForHostname

pkg/cmd/auth/login/login.go:247–263  ·  view source on GitHub ↗
(opts *LoginOptions)

Source from the content-addressed store, hash-verified

245}
246
247func promptForHostname(opts *LoginOptions) (string, error) {
248 options := []string{"GitHub.com", "Other"}
249 hostType, err := opts.Prompter.Select(
250 "Where do you use GitHub?",
251 options[0],
252 options)
253 if err != nil {
254 return "", err
255 }
256
257 isGitHubDotCom := hostType == 0
258 if isGitHubDotCom {
259 return ghinstance.Default(), nil
260 }
261
262 return opts.Prompter.InputHostname()
263}

Callers 2

Test_promptForHostnameFunction · 0.85
loginRunFunction · 0.85

Calls 3

DefaultFunction · 0.92
SelectMethod · 0.65
InputHostnameMethod · 0.65

Tested by 1

Test_promptForHostnameFunction · 0.68