github.com/pluralsh/plural-cli@v0.9.5/pkg/scm/surveys.go (about) 1 package scm 2 3 import ( 4 "github.com/AlecAivazis/survey/v2" 5 "github.com/pluralsh/plural-cli/pkg/utils" 6 ) 7 8 var validRepo = survey.ComposeValidators( 9 utils.ValidateAlphaNumeric, 10 survey.MaxLength(20), 11 ) 12 13 func repoName() (name string, err error) { 14 prompt := &survey.Input{ 15 Message: "Choose a memorable repo name:", 16 } 17 err = survey.AskOne(prompt, &name, survey.WithValidator(validRepo)) 18 return 19 }