diff --git a/cmd/root.go b/cmd/root.go index 360582f..4bb2250 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -45,7 +45,8 @@ func init() { rootCmd.AddCommand(&lastSeenCmd) } -func Execute() { +func Execute(version string) { + rootCmd.Version = version if err := rootCmd.Execute(); err != nil { os.Exit(1) } diff --git a/main.go b/main.go index 6db19f2..bd56336 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,8 @@ package main import "github.com/dsh2dsh/check_syncthing/cmd" +var version string + func main() { - cmd.Execute() + cmd.Execute(version) }