From 89f83d7a1fe57649fbd59e9a3da2806061cc5be2 Mon Sep 17 00:00:00 2001 From: Nikolaus Gotsche Date: Sun, 16 Sep 2018 03:32:17 +0200 Subject: gnu getopt style flags --- interact.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'interact.go') 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...") } -- cgit v1.2.3