summaryrefslogtreecommitdiff
path: root/interact.go
diff options
context:
space:
mode:
Diffstat (limited to 'interact.go')
-rw-r--r--interact.go43
1 files changed, 43 insertions, 0 deletions
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()