Fix invalid shell completion when used with ~/.cobra.yaml

`cobra completion` outputs invalid output "Using config file:" at the
top of the completion script. when ~/.cobra.yaml exists.
This commit is contained in:
darklore 2021-10-21 11:04:14 +09:00
parent c1973d31bf
commit 2d79bdff02
No known key found for this signature in database
GPG key ID: F45B52E27B30973B

View file

@ -74,6 +74,6 @@ func initConfig() {
viper.AutomaticEnv() viper.AutomaticEnv()
if err := viper.ReadInConfig(); err == nil { if err := viper.ReadInConfig(); err == nil {
fmt.Println("Using config file:", viper.ConfigFileUsed()) fmt.Fprintln(os.Stderr, "Using config file:", viper.ConfigFileUsed())
} }
} }