From aacc9602d59b36979d55ebd461c26e9b7afaeb2b Mon Sep 17 00:00:00 2001 From: Edouard Paris Date: Tue, 16 Apr 2019 13:40:56 +0200 Subject: [PATCH] fix cli, ui: add version --- cli/cli.go | 3 +++ ui/views/help.go | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cli/cli.go b/cli/cli.go index b2989b6..2df2ae6 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -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{ @@ -24,6 +26,7 @@ func New() *cli.App { return &cli.App{ Name: "lntop", + Version: version, EnableShellCompletion: true, Action: run, Flags: []cli.Flag{ diff --git a/ui/views/help.go b/ui/views/help.go index 176fa57..58bdc60 100644 --- a/ui/views/help.go +++ b/ui/views/help.go @@ -9,7 +9,8 @@ import ( ) const ( - HELP = "help" + version = "v0.0.1" + HELP = "help" ) type Help struct { @@ -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",