Fix invalid shell completion when used with ~/.cobra.yaml (#1510)

`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-12-08 08:00:50 +09:00 committed by GitHub
parent 3fed3ef5ad
commit 25bab5a398
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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