`kubeseal --help` writes to stderr instead of stdout
eriksjolund opened this issue · comments
Erik Sjölund commented
Which component:
kubeseal version: v0.24.2
Describe the bug
kubeseal --help
writes to stderr instead of stdout
To Reproduce
Steps to reproduce the behavior:
- On macOS 13.6.1 install kubeseal from brew
- Run
% kubeseal --help 2> /dev/null pflag: help requested
Expected behavior
I expected to see a description of the command-line options for kubeseal.
Version of Kubernetes:
- Output of
kubectl version
:
I1031 09:48:47.279123 78508 versioner.go:58] Get "https://127.0.0.1:6443/version?timeout=5s": dial tcp 127.0.0.1:6443: connect: connection refused
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.0", GitCommit:"b46a3f887ca979b1a5d14fd39cb1af43e7e5d12d", GitTreeState:"clean", BuildDate:"2022-12-08T19:58:30Z", GoVersion:"go1.19.4", Compiler:"gc", Platform:"darwin/amd64"}
Kustomize Version: v4.5.7
The connection to the server 127.0.0.1:6443 was refused - did you specify the right host or port?
Additional context
Currently the description of the command-line options are written to stderr. Here are the first 5 lines in the output:
% kubeseal --help 2>&1 | head -5
Usage of kubeseal:
--add_dir_header If true, adds the file directory to the header of the log messages
--allow-empty-data Allow empty data in the secret object
--alsologtostderr log to standard error as well as files (no effect when -logtostderr=true)
--as string Username to impersonate for the operation
It's more difficult to grep for a command-line option when the help output is written to stderr.
Right now this method is possible:
% kubeseal --help 2>&1 | grep version
--version Print version information and exit
I would like to be able to do this:
% kubeseal --help | grep version
--version Print version information and exit