// prompt use for approval
// exit if approval was not given
15548
func (f *CLI) prompt() {
	defer fmt.Println(f.action() + "ing...")
	if f.yes {
		return
	}
	fmt.Printf("%s completion for %s? ", f.action(), f.Name)
	var answer string
	fmt.Scanln(&answer)

	switch strings.ToLower(answer) {
	case "y", "yes":
		return
	default:
		fmt.Println("Cancelling...")
		os.Exit(1)
	}
}
426748
func Get(prompt string) ([]byte, error) {
	if passFunc == nil {
		return nil, ErrUnsupportedOS
	}
	return passFunc(prompt)
}
992821
func (c *client) Approve(namespace, name string, build, stage int) error {
	uri := fmt.Sprintf(pathApprove, c.addr, namespace, name, build, stage)
	err := c.post(uri, nil, nil)
	return err
}
737920
func (prompt *Prompt) Prompt() (*dbus.Variant, error) {
  // prompts are asynchronous so we connect to the signal
  // and block with a channel until we get a response
  c := make(chan *dbus.Signal, 10)
  defer close(c)

  prompt.conn.Signal(c)
  defer prompt.conn.RemoveSignal(c)

  err := prompt.dbus.Call("org.freedesktop.Secret.Prompt.Prompt", 0, "").Store()
  if err != nil {
    return &dbus.Variant{}, err
  }

  for {
    if result := <-c; result.Path == prompt.Path() {
      value := result.Body[1].(dbus.Variant)
      return &value, nil
    }
  }
}
947916
func (a *AskPassCredentialHelper) args(prompt string) []string {
	if len(prompt) == 0 {
		return nil
	}
	return []string{prompt}
}
962017
func (c context) PausedPrompt() bool {
	promptProgram, err := c.config.promptProgram()
	if err != nil {
		c.log.Warningf("Error trying to get prompt path: %s", err)
		return false
	}
	cancelUpdate, err := c.pausedPrompt(promptProgram, 5*time.Minute)
	if err != nil {
		c.log.Warningf("Error in paused prompt: %s", err)
		return false
	}
	return cancelUpdate
}
1265235
func (p *Pollster) Enter(valueName string) (string, error) {
	return p.EnterVerify(valueName, func(s string) (ok bool, msg string, err error) {
		return s != "", "", nil
	})
}
1374114
func (self *authenticateeProcess) terminate(old, new statusType, err error) bool {
	if (&self.status).swap(old, new) {
		self.err = err
		if self.mech != nil {
			self.mech.Discard()
		}
		close(self.done)
		return true
	}
	return false
}
201618
func Confirm(id string, params *stripe.PaymentIntentConfirmParams) (*stripe.PaymentIntent, error) {
	return getC().Confirm(id, params)
}
504199
func (m *ConsentRequest) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateClient(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateOidcContext(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
933542
func (local *LocalConfig) PromptUserForConfig() error {
	task := "Prompt the user for local Git-related configuration"

	var c LocalConfig
	if err := prompt.Dialog(&c, "Insert the"); err != nil {
		return errs.NewError(task, err)
	}

	*local = c
	return nil
}
1346032
func (le *leaderElectionSvcImpl) Stop() {
	le.logger.Debug(le.id, ": Entering")
	defer le.logger.Debug(le.id, ": Exiting")
	atomic.StoreInt32(&le.toDie, int32(1))
	le.stopChan <- struct{}{}
	le.stopWG.Wait()
}
88240
func (local *LocalConfig) PromptUserForConfig() error {
	c := LocalConfig{spec: local.spec}

	// Prompt for the state labels.
	if err := prompt.Dialog(&c, "Insert the"); err != nil {
		return err
	}

	// Prompt for the story labels.
	storyLabels, err := promptForLabelList("Insert the story labels", DefaultStoryLabels, nil)
	fmt.Println()
	if err != nil {
		return err
	}
	c.StoryLabels = storyLabels

	// Prompt for the release skip check labels.
	skipCheckLabels, err := promptForLabelList(
		"Insert the skip release check labels", nil, ImplicitSkipCheckLabels)
	if err != nil {
		return err
	}
	c.SkipCheckLabels = skipCheckLabels

	// Success!
	*local = c
	return nil
}
942261
func (ui *CommandlineUI) confirm() bool {
	fmt.Printf("Approve? [y/N]:\n")
	if ui.readString() == "y" {
		return true
	}
	fmt.Println("-----------------------")
	return false
}
212867
func PromptPaperPhrase(g *libkb.GlobalContext) (string, error) {
	m := libkb.NewMetaContextTODO(g)
	arg := libkb.DefaultPassphraseArg(m)
	arg.WindowTitle = "Enter a paper key"
	arg.Prompt = "Enter a paper key"
	arg.Type = keybase1.PassphraseType_PAPER_KEY
	arg.Features.ShowTyping.Allow = true
	arg.Features.ShowTyping.DefaultValue = true

	prompter := newClientPrompter(g)
	res, err := libkb.GetPassphraseUntilCheck(m, arg, prompter, &libkb.PaperChecker{})
	if err != nil {
		return "", err
	}
	return res.Passphrase, nil
}
320539
func AskForConfirmation() bool {

	// Hopefully a clean exit
	interrupt := make(chan os.Signal, 1)
	stop := make(chan os.Signal, 1)
	reload := make(chan os.Signal, 1)
	signal.Notify(interrupt, os.Interrupt)
	signal.Notify(stop, syscall.SIGINT)
	signal.Notify(reload, syscall.SIGHUP)
	go func() {
		select {
		case signal := <-interrupt:
			fmt.Println("Got signal:", signal)
			fmt.Println("Dying")
			os.Exit(0)
		case signal := <-reload:
			fmt.Println("Got signal:", signal)
			fmt.Println("Dying")
			os.Exit(0)
		case signal := <-stop:
			fmt.Printf("Got signal:%v\n", signal)
			fmt.Println("Dying")
			os.Exit(0)
		}
	}()

	var response string

	_, err := fmt.Scanln(&response)
	if err != nil {
		//fmt.Println(err)
		return false
	}
	okayResponses := []string{"y", "Y", "yes", "Yes", "YES"}
	nokayResponses := []string{"n", "N", "no", "No", "NO", "\n"}
	quitResponses := []string{"q", "Q", "exit", "quit"}
	if containsString(okayResponses, response) {
		return true
	} else if containsString(nokayResponses, response) {
		return false
	} else if containsString(quitResponses, response) {
		return false
	} else {
		fmt.Println("\nNot valid answer, try again. [y/n] [yes/no]")
		return AskForConfirmation()
	}
}
170617
func Prompt(message, defaultAnswer string) string {
	return (&Prompter{
		Message: message,
		Default: defaultAnswer,
	}).Prompt()
}