fix cli, ui: add version

pull/14/head v0.0.1
Edouard Paris 5 years ago
parent a4fad4f7d9
commit aacc9602d5

@ -15,6 +15,8 @@ import (
"github.com/edouardparis/lntop/ui" "github.com/edouardparis/lntop/ui"
) )
const version = "v0.0.1"
// New creates a new cli app. // New creates a new cli app.
func New() *cli.App { func New() *cli.App {
cli.VersionFlag = &cli.BoolFlag{ cli.VersionFlag = &cli.BoolFlag{
@ -24,6 +26,7 @@ func New() *cli.App {
return &cli.App{ return &cli.App{
Name: "lntop", Name: "lntop",
Version: version,
EnableShellCompletion: true, EnableShellCompletion: true,
Action: run, Action: run,
Flags: []cli.Flag{ Flags: []cli.Flag{

@ -9,7 +9,8 @@ import (
) )
const ( const (
HELP = "help" version = "v0.0.1"
HELP = "help"
) )
type Help struct { type Help struct {
@ -50,7 +51,7 @@ func (h Help) Set(g *gocui.Gui, x0, y0, x1, y1 int) error {
} }
} }
h.view.Frame = false 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, "Released under the MIT License")
fmt.Fprintln(h.view, "") fmt.Fprintln(h.view, "")
fmt.Fprintln(h.view, fmt.Sprintf("%5s %s", fmt.Fprintln(h.view, fmt.Sprintf("%5s %s",

Loading…
Cancel
Save