From 678de29b42ffbf8e0ebc0fcd899cd79a8343273f Mon Sep 17 00:00:00 2001 From: Nikolaus Gotsche Date: Sun, 14 Oct 2018 16:25:11 +0200 Subject: Added Comments and Variables in DB. sql not backward compatible :( --- interact.go | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'interact.go') diff --git a/interact.go b/interact.go index 24f4e34..3c458e4 100644 --- a/interact.go +++ b/interact.go @@ -727,6 +727,49 @@ func getNewInterInput(question,old string) (string) { } } +func getInterMultiInput(question string) (out string) { + shell := ishell.New() + //shell.ShowPrompt(false) + //defer shell.ShowPrompt(true) + + shell.Println(question,"(Multiline input, end with ';')") + out = shell.ReadMultiLines(";") + shell.Println(" -Done-") + + return +} + +func getNewInterMultiInput(question,old string) (out string) { + shell := ishell.New() + //shell.ShowPrompt(false) + //defer shell.ShowPrompt(true) + + if old != "" { + shell.Println("Current:\n",old) + } + shell.Println("Should current entry be replaced? A Newline will be added otherwise") + if isInterSure(" "){ + shell.Println(question,"(Multiline input, end with ';')") + out = shell.ReadMultiLines(";") + shell.Println(" -Done-") + }else{ + shell.Print(question) + txt := shell.ReadLine() + if txt == "" { + out = old + }else{ + out = old + "\n" + txt + } + } + + return + /*if line == "" { + return old + }else{ + return line + }*/ +} + func multichoice(about string) { shell := ishell.New() -- cgit v1.2.3