Skip to content

Commit

Permalink
feat: add version flag (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
smurawski committed May 22, 2023
1 parent d417971 commit fd33ed7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ import (
"github.com/spf13/viper"
)

// Global for Debug logging flag.
var debug bool
// Globals for Debug logging flag and version reporting.
var (
debug bool
version string
)

func newRootCmd() *cobra.Command {
rootCmd := &cobra.Command{
Expand All @@ -32,6 +35,7 @@ func newRootCmd() *cobra.Command {
return cmd.Usage()
},
SilenceUsage: true,
Version: version,
}

flags := rootCmd.PersistentFlags()
Expand Down

0 comments on commit fd33ed7

Please sign in to comment.