func (s *RegistrationContext) askExecutor() string {
	for {
		names := common.GetExecutors()
		executors := strings.Join(names, ", ")
		result := s.ask("executor", "Please enter the executor: "+executors+":", true)
		if common.NewExecutor(result) != nil {
			return result
		}
	}
}
Пример #2
0
func (s *RegisterCommand) askExecutor() {
	for {
		names := common.GetExecutors()
		executors := strings.Join(names, ", ")
		s.Executor = s.ask("executor", "Please enter the executor: "+executors+":", true)
		if common.NewExecutor(s.Executor) != nil {
			return
		} else {
			message := "Invalid executor specified"
			if s.NonInteractive {
				log.Fatalln(message)
			} else {
				log.Errorln(message)
			}
		}
	}
}