summaryrefslogtreecommitdiff
path: root/interact.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2018-10-02 02:14:42 +0200
committerNikolaus Gotsche <n@softwarefools.com>2018-10-02 02:14:42 +0200
commita4a53949409944ae1745a8ab16901fb9a21ac7c4 (patch)
tree8a7840c1e6f1146961c76914abf9ec3613a2750c /interact.go
parentba96c6fae2ca3ea3399934ffd010cecfbaec273c (diff)
new IsSure
Diffstat (limited to 'interact.go')
-rw-r--r--interact.go12
1 files changed, 12 insertions, 0 deletions
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()