From 260a48ab7fd2fc6b8954541d7c68d7feb291bf42 Mon Sep 17 00:00:00 2001 From: lauralani Date: Fri, 7 Jul 2023 09:32:15 +0200 Subject: [PATCH] add version flag --- cmd/root.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/root.go b/cmd/root.go index 0c7a45c..f49c251 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -43,6 +43,7 @@ func init() { rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "config file (default is $workingdir/config.yaml)") rootCmd.PersistentFlags().BoolVarP(&log.FlagDebug, "debug", "d", false, "enable debug logging") + rootCmd.Version = constants.AppVersion // Cobra also supports local flags, which will only run // when this action is called directly. // rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")