Add default answer hint to kill process prompt

Also supports capitalized answers.
This commit is contained in:
Seth W. Klein 2015-05-07 01:40:44 -04:00
parent b24abcd325
commit 31658f37dc

@ -132,11 +132,11 @@ func handleExit(client service.Client, t *Term) (error, int) {
}
}
answer, err := t.line.Prompt("Would you like to kill the process? [y/n] ")
answer, err := t.line.Prompt("Would you like to kill the process? [y/N] ")
if err != nil {
return io.EOF, 2
}
answer = strings.TrimSuffix(answer, "\n")
answer = strings.ToLower(strings.TrimSpace(answer))
kill := (answer == "y")
err = client.Detach(kill)