Skip to content

Commit

Permalink
fix cli, ui: add version
Browse files Browse the repository at this point in the history
  • Loading branch information
edouardparis committed Apr 16, 2019
1 parent a4fad4f commit aacc960
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
"github.com/edouardparis/lntop/ui"
)

const version = "v0.0.1"

// New creates a new cli app.
func New() *cli.App {
cli.VersionFlag = &cli.BoolFlag{
Expand All @@ -24,6 +26,7 @@ func New() *cli.App {

return &cli.App{
Name: "lntop",
Version: version,
EnableShellCompletion: true,
Action: run,
Flags: []cli.Flag{
Expand Down
5 changes: 3 additions & 2 deletions ui/views/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import (
)

const (
HELP = "help"
version = "v0.0.1"
HELP = "help"
)

type Help struct {
Expand Down Expand Up @@ -50,7 +51,7 @@ func (h Help) Set(g *gocui.Gui, x0, y0, x1, y1 int) error {
}
}
h.view.Frame = false
fmt.Fprintln(h.view, "lntop 0.0.0 - (C) 2019 Edouard Paris")
fmt.Fprintln(h.view, fmt.Sprintf("lntop %s - (C) 2019 Edouard Paris", version))
fmt.Fprintln(h.view, "Released under the MIT License")
fmt.Fprintln(h.view, "")
fmt.Fprintln(h.view, fmt.Sprintf("%5s %s",
Expand Down

0 comments on commit aacc960

Please sign in to comment.