mirror of
https://github.com/edouardparis/lntop
synced 2024-11-16 00:12:44 +00:00
fix cli, ui: add version
This commit is contained in:
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,6 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
version = "v0.0.1"
|
||||||
HELP = "help"
|
HELP = "help"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -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…
Reference in New Issue
Block a user