From a4a53949409944ae1745a8ab16901fb9a21ac7c4 Mon Sep 17 00:00:00 2001 From: Nikolaus Gotsche Date: Tue, 2 Oct 2018 02:14:42 +0200 Subject: new IsSure --- interact.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'interact.go') diff --git a/interact.go b/interact.go index 932ce1d..906d221 100644 --- a/interact.go +++ b/interact.go @@ -644,7 +644,19 @@ func interact() { //fmt.Println("Laboravi emeritus...") } +func isInterSure(question string) (bool) { + shell := ishell.New() + shell.ShowPrompt(false) + defer shell.ShowPrompt(true) + shell.Printf("%s (type 'y/Y/yes' to confirm) : ",question) + line := shell.ReadLine() + if ( line == "yes" || line == "y" || line == "Y") { + return true + } else { + return false + } +} func getInterInput(question string) (out string) { shell := ishell.New() -- cgit v1.2.3