summaryrefslogtreecommitdiff
path: root/interact.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2018-09-16 03:32:17 +0200
committerNikolaus Gotsche <n@softwarefools.com>2018-09-16 03:32:17 +0200
commit89f83d7a1fe57649fbd59e9a3da2806061cc5be2 (patch)
treef592a77875471df8fe8a6dc7d7385bcdd3e1a3e4 /interact.go
parentf82c6ff724d6e56052c40f409be785b796eca2ab (diff)
gnu getopt style flags
Diffstat (limited to 'interact.go')
-rw-r--r--interact.go18
1 files changed, 8 insertions, 10 deletions
diff --git a/interact.go b/interact.go
index 7514046..741d622 100644
--- a/interact.go
+++ b/interact.go
@@ -1,7 +1,7 @@
package main
import (
- "os"
+ //"os"
"strings"
"strconv"
"fmt"
@@ -13,7 +13,7 @@ import (
func interact() {
- stdOut()
+ //stdOut()
shell := ishell.New()
//fmt.Println(os.Args)
@@ -22,7 +22,6 @@ func interact() {
green := color.New(color.FgGreen).SprintFunc()
boldBlue := color.New(color.FgBlue, color.Bold).SprintFunc()
boldRed := color.New(color.FgRed, color.Bold).SprintFunc()
-
boldMag := color.New(color.FgMagenta, color.Bold).SprintFunc()
boldCyan := color.New(color.FgCyan, color.Bold).SprintFunc()
boldGreen := color.New(color.FgGreen, color.Bold).SprintFunc()
@@ -565,23 +564,22 @@ func interact() {
},
})
- //shell.Run()
- // teardown
- //shell.Close()
-// when started with "exit" as first argument, assume non-interact ive execution
- args := removeStringFromArray(os.Args[1:],"-file",1)
+ // Decide if interactive mode should be started
+ //args := removeStringFromArray(os.Args[1:],"-file",1)
- if len(args) > 0 {
+ if len(interArgs) > 0 {
//args := removeStringFromArray(os.Args[1:],"-file",1)
//fmt.Println(args)
- shell.Process(args...)
+ shell.Process(interArgs...)
} else {
shell.Println("Starting interactive Shell")
+ stdOut()
//start shell
shell.Run()
// teardown
shell.Close()
}
+ fmt.Println("Laboravi emeritus...")
}