Skip to content

Commit

Permalink
Fix invalid shell completion when used with ~/.cobra.yaml (spf13#1510)
Browse files Browse the repository at this point in the history
`cobra completion` outputs invalid output "Using config file:" at the
top of the completion script. when ~/.cobra.yaml exists.
  • Loading branch information
darklore authored and umarcor committed Nov 5, 2021
1 parent c6e7365 commit a49de56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cobra/cmd/root.go
Expand Up @@ -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())
}
}

0 comments on commit a49de56

Please sign in to comment.