From e4288bccb30832565d60b2f874ef2d170367b572 Mon Sep 17 00:00:00 2001 From: igorlombacx Date: Mon, 9 Oct 2023 17:24:14 +0100 Subject: [PATCH 1/2] printing CLI version if debug is enabled --- cmd/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/main.go b/cmd/main.go index 756a2902d..35c0320e8 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -25,6 +25,9 @@ const ( func main() { var err error + if strings.Contains(strings.Join(os.Args[1:], ","), "--debug") { + logger.Printf("CLI VERSION: %s", params.Version) + } bindProxy() bindKeysToEnvAndDefault() configuration.LoadConfiguration() From cc4b4d2d25c0d3b4b7cc6355ada54a9a828885aa Mon Sep 17 00:00:00 2001 From: igorlombacx Date: Wed, 11 Oct 2023 10:32:48 +0100 Subject: [PATCH 2/2] printing cli version if debug flag is enabled --- cmd/main.go | 3 --- internal/commands/root.go | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 35c0320e8..756a2902d 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -25,9 +25,6 @@ const ( func main() { var err error - if strings.Contains(strings.Join(os.Args[1:], ","), "--debug") { - logger.Printf("CLI VERSION: %s", params.Version) - } bindProxy() bindKeysToEnvAndDefault() configuration.LoadConfiguration() diff --git a/internal/commands/root.go b/internal/commands/root.go index 43fcd2367..3827576f3 100644 --- a/internal/commands/root.go +++ b/internal/commands/root.go @@ -214,6 +214,7 @@ func requiredFeatureFlagsCheck(cmd *cobra.Command) bool { const configFormatString = "%30v: %s" func PrintConfiguration() { + logger.PrintfIfVerbose("CLI Version: %s", params.Version) logger.PrintIfVerbose("CLI Configuration:") for param := range util.Properties { logger.PrintIfVerbose(fmt.Sprintf(configFormatString, param, viper.GetString(param)))