mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
Merge 2248ac1e28 into d3edc58ef7
This commit is contained in:
commit
d7c4b6a0b7
1 changed files with 4 additions and 1 deletions
|
|
@ -143,10 +143,13 @@ func (p *terminalPrompter) PromptPassword(prompt string) (passwd string, err err
|
|||
// choice to be made, returning that choice.
|
||||
func (p *terminalPrompter) PromptConfirm(prompt string) (bool, error) {
|
||||
input, err := p.PromptInput(prompt + " [y/n] ")
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if len(input) > 0 && strings.EqualFold(input[:1], "y") {
|
||||
return true, nil
|
||||
}
|
||||
return false, err
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// SetHistory sets the input scrollback history that the prompter will allow
|
||||
|
|
|
|||
Loading…
Reference in a new issue