diff options
Diffstat (limited to 'interact.go')
| -rw-r--r-- | interact.go | 40 |
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", |
