Skip to content

Commit

Permalink
feat: add version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
moyiz committed Dec 19, 2023
1 parent 9943086 commit c55e389
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ before:
builds:
- env:
- CGO_ENABLED=0
ldflags:
- -X github.com/moyiz/na/cmd.Version={{.Version}}
goos:
- linux
- darwin
Expand Down
11 changes: 7 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ import (
"github.com/spf13/cobra"
)

var Version string

var rootCmd = &cobra.Command{
Use: "na",
Short: "CLI tool to effortlessly manage context aware nested shortcuts for shell commands.",
Long: consts.Logo,
Run: listRun,
Use: "na",
Short: "CLI tool to effortlessly manage context aware nested shortcuts for shell commands.",
Long: consts.Logo,
Run: listRun,
Version: Version,
}

func getConfigFromArgs() (string, error) {
Expand Down

0 comments on commit c55e389

Please sign in to comment.