Skip to content

Commit dedc802

Browse files
darkloreumarcor
authored andcommitted
Fix invalid shell completion when used with ~/.cobra.yaml (spf13#1510)
`cobra completion` outputs invalid output "Using config file:" at the top of the completion script. when ~/.cobra.yaml exists.
1 parent 8371a1a commit dedc802

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cobra/cmd/root.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ func initConfig() {
7474
viper.AutomaticEnv()
7575

7676
if err := viper.ReadInConfig(); err == nil {
77-
fmt.Println("Using config file:", viper.ConfigFileUsed())
77+
fmt.Fprintln(os.Stderr, "Using config file:", viper.ConfigFileUsed())
7878
}
7979
}

0 commit comments

Comments
 (0)