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
1 changed files with 1 additions and 1 deletions

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())
} }
} }