Skip to content
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

[Bug]: error messages and warnings should consistently go to stderr #643

Open
jschauma opened this issue Sep 13, 2024 · 1 comment
Open
Labels
bug issues that report a bug

Comments

@jschauma
Copy link
Contributor

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

@jschauma jschauma added the bug issues that report a bug label Sep 13, 2024
jschauma added a commit to jschauma/linode-cli that referenced this issue Sep 13, 2024
This should help address linode#643,
although possibly only in part.
@ykim-akamai
Copy link
Contributor

@jschauma Thank you for the contribution! Team will review the PR shortly 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues that report a bug
Projects
None yet
Development

No branches or pull requests

2 participants