diff options
| author | Nikolaus Gotsche <n@softwarefools.com> | 2018-09-12 13:57:14 +0200 |
|---|---|---|
| committer | Nikolaus Gotsche <n@softwarefools.com> | 2018-09-12 13:57:14 +0200 |
| commit | 4fa9a4e986d457b406236fc62a5955a2275b83a9 (patch) | |
| tree | 4811269099d424acc1771ea935be9c9b3e7dbaf6 /interact.go | |
| parent | ab1e57948af2e391e50d7aec5eadad7d1c203c35 (diff) | |
delete Bill, minor beautification
Diffstat (limited to 'interact.go')
| -rw-r--r-- | interact.go | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/interact.go b/interact.go index a37c665..a18a7a8 100644 --- a/interact.go +++ b/interact.go @@ -95,6 +95,30 @@ func interact() { }) shell.AddCmd(&ishell.Cmd{ + Name: "deletebill", + Help: "<id> Delete a Bill with the following id", + Func: func(c *ishell.Context) { + //c.Print("\033[H\033[2J") + arg := "none" + if len(c.Args) > 0 { + arg = strings.Join(c.Args, " ") + argi,err := strconv.Atoi(arg) + if err == nil{ + //c.Println(boldGreen("Opening Project",argi)) + deleteBill(argi) + stdOut() + }else{ + c.Println(boldRed(arg,"is not a valid id!")) + } + }else{ + c.Println(boldRed("deletetask <id> - Please enter an id")) + showLastBills(0) + } + c.Println(boldBlue("______________________")) + }, + }) + + shell.AddCmd(&ishell.Cmd{ Name: "deletetask", Help: "<id> Delete a Task with the following id", Func: func(c *ishell.Context) { @@ -295,7 +319,7 @@ func interact() { } //c.Print("\033[H\033[2J") //c.Println(boldGreen("Start New Project")) - stdOut() + //stdOut() c.Println(boldBlue("______________________")) }, }) |
