From 79587a992c120a3beee0d5c8e07d84426a68ec3a Mon Sep 17 00:00:00 2001 From: lauralani Date: Fri, 24 Mar 2023 16:27:24 +0100 Subject: [PATCH] add version --- cmd/constants.go | 9 +++++++++ cmd/root.go | 14 +------------- 2 files changed, 10 insertions(+), 13 deletions(-) create mode 100644 cmd/constants.go diff --git a/cmd/constants.go b/cmd/constants.go new file mode 100644 index 0000000..f92ef79 --- /dev/null +++ b/cmd/constants.go @@ -0,0 +1,9 @@ +/* +Copyright © 2023 Laura Kalb +*/ + +package cmd + +const ( + ipam_version = "DEVEL" +) diff --git a/cmd/root.go b/cmd/root.go index cf96f40..211d4cf 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -12,16 +12,13 @@ import ( "github.com/spf13/viper" ) -// rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ Use: "ipam", Short: "A cli based ipam", Long: `A cli based ipam. You can manage subnets, single ip addresses within those, and the corresponding A records. PowerDNS and IPV6-Support will follow`, - // Uncomment the following line if your bare application - // has an action associated with it: - // Run: func(cmd *cobra.Command, args []string) { }, + Version: ipam_version, } // Execute adds all child commands to the root command and sets flags appropriately. @@ -34,18 +31,9 @@ func Execute() { } func init() { - // Here you will define your flags and configuration settings. - // Cobra supports persistent flags, which, if defined here, - // will be global for your application. - - // rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.ipam.yaml)") - - // Cobra also supports local flags, which will only run - // when this action is called directly. cobra.OnInitialize(initConfig) rootCmd.Flags().BoolP("debug", "d", false, "Enable debug mode. (may print sensitive Information, so please watch out!)") - // rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cobra.yaml)") } func initConfig() {