corneliusweig / ketall

Like `kubectl get all`, but get really all resources
Apache License 2.0
679 stars 28 forks source link

Shell completion does not work properly #154

Closed marckhouzam closed 3 years ago

marckhouzam commented 3 years ago

Describe the bug Debug output is mistakenly shown in the shell completion choices:

$ ./ketall <TAB>
completion   -- generate the autocompletion script for the specified shell
help         -- Help about any command
version      -- Print the version information
:4           Completion ended with directive: ShellCompDirectiveNoFileComp

The problem is that Cobra's shell completion sends debug printouts to stderr but ketall redirects it to stdout.

To Reproduce Steps to reproduce the behaviour:

make dev
source <(./ketall completion zsh)
compdef _ketall ketall
./ketall <TAB>

Expected behavior Debug message should not be shown during shell completion

I will be posting a PR soon.