support --version using -X

This commit is contained in:
fiatjaf 2024-09-15 08:57:53 -03:00
parent 9bbc87b27a
commit 9d02301b2d
2 changed files with 4 additions and 0 deletions

View File

@ -40,6 +40,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
ldflags: -X main.version=${{ github.ref }}
overwrite: true
md5sum: false
sha256sum: false

View File

@ -7,6 +7,8 @@ import (
"github.com/fiatjaf/cli/v3"
)
var version string = "debug"
var app = &cli.Command{
Name: "nak",
Suggest: true,
@ -27,6 +29,7 @@ var app = &cli.Command{
bunker,
serve,
},
Version: version,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "quiet",