mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
18 lines
284 B
Go
18 lines
284 B
Go
package cmd
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
func init() {
|
|
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_"))
|
|
viper.AutomaticEnv()
|
|
}
|
|
|
|
func bindFlagsToViper(cmd *cobra.Command) error {
|
|
return viper.BindPFlags(cmd.Flags())
|
|
}
|