linode-cli
linode-cli copied to clipboard
[Bug]: error messages and warnings should consistently go to stderr
CLI Version
linode-cli v5.51.0 Built from spec version 4.176.0
Command
linode-cli linodes create [...args...] --json | jq -r .[].id
Output
parse error: Invalid numeric literal at line 1, column 6
Expected Behavior
12345678
Actual Behavior
The problem occurs because linode-cli prints warnings and error messages to stdout. In this case, the (successful) command prints
Using default values: {'authorized_users': ['jschauma']}; use the --no-defaults flag to disable defaults
to stdout before printing the json output. This then leads to tools not being able to consume the output as expected.
The correct behavior here is to send all error messages and warnings to stderr, like a good little Unix tool.
Steps to Reproduce
linode-cli linodes create [...args that produce a warning...] --json | jq -r .[].id