From 83de93d7cc213ecbf40fdffb3f536d5a40868b1b Mon Sep 17 00:00:00 2001 From: jmeridth Date: Wed, 15 Jan 2025 17:27:00 -0600 Subject: [PATCH] fix: extract cobra function to allow calling later from core This ensures the persistent flags we wire up in cobra get applied Signed-off-by: jmeridth --- command/command.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/command/command.go b/command/command.go index 7cad75a..40e8303 100644 --- a/command/command.go +++ b/command/command.go @@ -32,8 +32,9 @@ func SetBase(cmd *cobra.Command) { viper.BindPFlag("write", cmd.PersistentFlags().Lookup("write")) cmd.PersistentFlags().BoolP("help", "h", false, "Give me a heading! Help for the specified command") +} - // Initialize Viper +func ReadConfig() { viper.SetConfigFile(viper.GetString("config")) viper.AutomaticEnv()