summaryrefslogtreecommitdiff
path: root/interact.go
diff options
context:
space:
mode:
Diffstat (limited to 'interact.go')
-rw-r--r--interact.go26
1 files changed, 15 insertions, 11 deletions
diff --git a/interact.go b/interact.go
index a18a7a8..31e93e6 100644
--- a/interact.go
+++ b/interact.go
@@ -1,7 +1,7 @@
package main
import (
- //"os"
+ "os"
"strings"
"strconv"
"fmt"
@@ -16,6 +16,7 @@ func interact() {
stdOut()
shell := ishell.New()
+ //fmt.Println(os.Args)
//cyan := color.New(color.FgCyan).SprintFunc()
//yellow := color.New(color.FgYellow).SprintFunc()
green := color.New(color.FgGreen).SprintFunc()
@@ -400,7 +401,7 @@ func interact() {
if multicust {
c.Println("Cannot Write One Bill to multiple Customers! Please Select different Tasks")
-
+
}else{
// CHECK IF ONLY ONE PROJECT ELSE CHOOSE ONE
if multiproj {
@@ -507,18 +508,21 @@ func interact() {
},
})
- shell.Run()
+ //shell.Run()
// teardown
- shell.Close()
+ //shell.Close()
// when started with "exit" as first argument, assume non-interact ive execution
- // if len(os.Args) > 1 && os.Args[1] == "exit" {
- // shell.Process(os.Args[2:]...)
- // } else {
- // start shell
- // shell.Run()
+
+ if len(os.Args) > 1 {
+ args := removeStringFromArray(os.Args[1:],"-file",1)
+ //fmt.Println(args)
+ shell.Process(args...)
+ } else {
+ //start shell
+ shell.Run()
// teardown
- // shell.Close()
- //}
+ shell.Close()
+ }
}