add flag --version (#255)

* client: print version

* arkd: add --version
This commit is contained in:
Marco Argentieri
2024-08-15 03:51:16 +02:00
committed by GitHub
parent 62ea14ddb5
commit 6ce090bf53
2 changed files with 7 additions and 11 deletions

View File

@@ -17,8 +17,6 @@ import (
"github.com/urfave/cli/v2"
)
var version = "alpha"
var (
balanceCommand = cli.Command{
Name: "balance",
@@ -151,12 +149,14 @@ var (
}
)
var Version string
func main() {
app := cli.NewApp()
app.Version = version
app.Name = "Ark CLI"
app.Usage = "ark wallet command line interface"
app.Version = Version
app.Usage = "Ark wallet command line interface"
app.Commands = append(
app.Commands,
&balanceCommand,

View File

@@ -15,12 +15,8 @@ import (
"github.com/urfave/cli/v2"
)
//nolint:all
var (
version = "dev"
commit = "none"
date = "unknown"
)
// Version will be set during build time
var Version string
// flags
var (
@@ -105,7 +101,7 @@ func mainAction(_ *cli.Context) error {
func main() {
app := cli.NewApp()
app.Version = version
app.Version = Version
app.Name = "Arkd CLI"
app.Usage = "arkd command line interface"
app.Commands = append(app.Commands, walletCmd)