-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix invalid shell completion when used with ~/.cobra.yaml #1510
Conversation
`cobra completion` outputs invalid output "Using config file:" at the top of the completion script. when ~/.cobra.yaml exists.
@darklore thanks for the PR. |
Sorry. Reproduce steps
Problem
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can reproduce this.
When there's a cobra configuration file, the Cobra cli always prints "Using config file:..." to stdout, which ends up in the shell completion scripts of the Cobra cli.
Sending that output to stderr as done by this PR seems like a reasonable solution. I don't think backwards-compatibility is a big concern in this case.
Thanks @darklore !
`cobra completion` outputs invalid output "Using config file:" at the top of the completion script. when ~/.cobra.yaml exists.
`cobra completion` outputs invalid output "Using config file:" at the top of the completion script. when ~/.cobra.yaml exists.
`cobra completion` outputs invalid output "Using config file:" at the top of the completion script. when ~/.cobra.yaml exists.
`cobra completion` outputs invalid output "Using config file:" at the top of the completion script. when ~/.cobra.yaml exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! 👍
`cobra completion` outputs invalid output "Using config file:" at the top of the completion script. when ~/.cobra.yaml exists.
cobra completion
outputs invalid output "Using config file:" at the top of the completion script. when ~/.cobra.yaml exists.