summaryrefslogtreecommitdiff
path: root/interact.go
diff options
context:
space:
mode:
authorNikolaus Gotsche <n@softwarefools.com>2018-09-12 02:37:44 +0200
committerNikolaus Gotsche <n@softwarefools.com>2018-09-12 02:37:44 +0200
commit06c06f5f6427f6da22b2476fa208e8c4ce54b7ee (patch)
treeb1ecc69ccc3ca6e915b6f4084598b530fbf24d04 /interact.go
parentfd4a4409ee8e6b772db30611e968778b68eca0d6 (diff)
Conf/DB into Home Dir, general beautification and debug
Diffstat (limited to 'interact.go')
-rw-r--r--interact.go40
1 files changed, 35 insertions, 5 deletions
diff --git a/interact.go b/interact.go
index b494222..e336535 100644
--- a/interact.go
+++ b/interact.go
@@ -16,8 +16,8 @@ func interact() {
stdOut()
shell := ishell.New()
- cyan := color.New(color.FgCyan).SprintFunc()
- yellow := color.New(color.FgYellow).SprintFunc()
+ //cyan := color.New(color.FgCyan).SprintFunc()
+ //yellow := color.New(color.FgYellow).SprintFunc()
green := color.New(color.FgGreen).SprintFunc()
// boldGreen := color.New(color.FgGreen, color.Bold).SprintFunc()
boldRed := color.New(color.FgRed, color.Bold).SprintFunc()
@@ -165,7 +165,6 @@ func interact() {
arg = strings.Join(c.Args, " ")
argi,err := strconv.Atoi(arg)
if err == nil{
- //c.Println(boldGreen("Edit Project",argi))
editProject(argi)
allProjects()
//stdOut()
@@ -239,7 +238,7 @@ func interact() {
shell.AddCmd(&ishell.Cmd{
Name: "all",
- Help: "Show all Projects Project",
+ Help: "Show all Projects",
Func: func(c *ishell.Context) {
//c.Print("\033[H\033[2J")
//c.Println(boldGreen("Start New Project"))
@@ -248,7 +247,38 @@ func interact() {
},
})
+ shell.AddCmd(&ishell.Cmd{
+ Name: "allbills",
+ Help: "Show all Bills",
+ Func: func(c *ishell.Context) {
+ //c.Print("\033[H\033[2J")
+ //c.Println(boldGreen("Start New Project"))
+ showLastBills(0)
+ },
+ })
+ shell.AddCmd(&ishell.Cmd{
+ Name: "showbills",
+ Help: "<n> - Show the last n bills",
+ Func: func(c *ishell.Context) {
+ arg := "none"
+ if len(c.Args) > 0 {
+ arg = strings.Join(c.Args, " ")
+ argi,err := strconv.Atoi(arg)
+ if err == nil{
+ showLastBills(argi)
+ }else{
+ c.Println(boldRed(arg,"is not a valid integer!"))
+ }
+ }else{
+ c.Println(boldRed("showbills <n> - Please enter an integer"))
+ }
+ //c.Print("\033[H\033[2J")
+ //c.Println(boldGreen("Start New Project"))
+ stdOut()
+ },
+ })
+/*
shell.AddCmd(&ishell.Cmd{
Name: "color",
Help: "color print",
@@ -297,7 +327,7 @@ func interact() {
c.Println("Your choices are", strings.Join(out(), ", "))
},
})
-
+*/
// Gather Tasks For Bills
shell.AddCmd(&ishell.Cmd{
Name: "bill",