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