diff options
| author | Nikolaus Gotsche <n@softwarefools.com> | 2019-04-21 00:39:21 +0200 |
|---|---|---|
| committer | Nikolaus Gotsche <n@softwarefools.com> | 2019-04-21 00:39:21 +0200 |
| commit | 4a387707386c666b0210259ff8c18d6e9d6a5532 (patch) | |
| tree | b50c8a7bda51e71325b152ac5bca9f5718d0cf7f /interact.go | |
| parent | 29539d25c1bc60db1f0745b969c8a9692eee27a7 (diff) | |
Show any Project0.3.10
Diffstat (limited to 'interact.go')
| -rw-r--r-- | interact.go | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/interact.go b/interact.go index d25c644..ba4fa67 100644 --- a/interact.go +++ b/interact.go @@ -506,7 +506,7 @@ func interact(fulldb bool) { { showcmd := &ishell.Cmd{ Name: "show", - Help: "all / customers / bills", + Help: "all / customers / bills / invoice / project", LongHelp: ` Usage: show <command>`, // Show all Projects with a small summary sorted by Customer.`, } @@ -603,6 +603,34 @@ func interact(fulldb bool) { c.Println(promptcol("______________________")) }, }) + showcmd.AddCmd(&ishell.Cmd{ + Name: "project", + Help: "<id> - Show details of the project with given id.", + LongHelp: ` Usage: show invoice <id> + Show detailed information of Project with given id. If no <id> is specified a selection screen is shown.`, + 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 { + ShowProjectStatus(argi) + //allProjects() + //stdOut() + } else { + c.Println(boldRed(arg, "is not a valid id!")) + } + } else { + pids := GetProjectIds() + selids, lids := getProjectList(pids) + choice := c.MultiChoice(lids, "Select a Project to Show") + if choice > -1 { + ShowProjectStatus(selids[choice]) + } + } + c.Println(promptcol("______________________")) + }, + }) shell.AddCmd(showcmd) } /* |
