From 7ad6956c401414f3c0426762966a89589cfca977 Mon Sep 17 00:00:00 2001 From: Antonio Mika Date: Fri, 8 Mar 2024 08:56:04 -0500 Subject: [PATCH] Enable the use of environment vars (#300) --- cmd/sish.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/sish.go b/cmd/sish.go index d7c2dcd..2683a82 100644 --- a/cmd/sish.go +++ b/cmd/sish.go @@ -6,6 +6,7 @@ import ( "io" "log" "os" + "strings" "time" "github.com/antoniomika/sish/sshmuxer" @@ -161,6 +162,8 @@ func initConfig() { log.Println("Unable to bind pflags:", err) } + viper.SetEnvPrefix(rootCmd.Use) + viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_")) viper.AutomaticEnv() if err := viper.ReadInConfig(); err == nil {