diff --git a/cli/cli.go b/cli/cli.go index 88cd102..5f109f1 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -7,7 +7,6 @@ import ( cli "gopkg.in/urfave/cli.v2" - "github.com/edouardparis/lntop" "github.com/edouardparis/lntop/app" "github.com/edouardparis/lntop/config" "github.com/edouardparis/lntop/events" @@ -17,7 +16,7 @@ import ( ) // New creates a new cli app. -func New() *cli.App { +func New(version string) *cli.App { cli.VersionFlag = &cli.BoolFlag{ Name: "version", Aliases: []string{}, Usage: "print the version", @@ -25,7 +24,7 @@ func New() *cli.App { return &cli.App{ Name: "lntop", - Version: lntop.Version, + Version: version, Usage: "LN channels viewer", EnableShellCompletion: true, Action: run, diff --git a/cmd/lntop/main.go b/cmd/lntop/main.go deleted file mode 100644 index 40d3665..0000000 --- a/cmd/lntop/main.go +++ /dev/null @@ -1,15 +0,0 @@ -package main - -import ( - "log" - "os" - - "github.com/edouardparis/lntop/cli" -) - -func main() { - err := cli.New().Run(os.Args) - if err != nil { - log.Fatal(err) - } -} diff --git a/doc.go b/main.go similarity index 70% rename from doc.go rename to main.go index 19044c0..a28856e 100644 --- a/doc.go +++ b/main.go @@ -1,4 +1,3 @@ -// lntop v0.0.0 // Released under the MIT License // // Lightning is a decentralized network using smart contract functionality @@ -8,4 +7,20 @@ // // lntop is an interactive text-mode channels viewer for Unix systems. // It supports for the moment the Go implementation lnd only. -package lntop +package main + +import ( + "log" + "os" + + "github.com/edouardparis/lntop/cli" +) + +const Version = "v0.3.0" + +func main() { + err := cli.New(Version).Run(os.Args) + if err != nil { + log.Fatal(err) + } +} diff --git a/version.go b/version.go deleted file mode 100644 index 07f0604..0000000 --- a/version.go +++ /dev/null @@ -1,3 +0,0 @@ -package lntop - -const Version = "v0.3.0"