Skip to content

Commit

Permalink
fix: extract cobra function to allow calling later from core (#51)
Browse files Browse the repository at this point in the history
This ensures the persistent flags we wire up in cobra get applied

Signed-off-by: jmeridth <[email protected]>
  • Loading branch information
jmeridth authored Jan 15, 2025
1 parent 8c93bdd commit 113eb5a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 113eb5a

Please sign in to comment.