Conversation
Remove progress, success, and error messages from stdout. Commands now output only JSON or nothing, using exit codes for errors.
|
I tried using checking if we had a TTY or pipe output to toggle output, but thought it was too complex at this stage. Think it's better we try to make it super simple, then we can add fancy feedback/UI as optional things (could be automatic via TTY check). Please test this version out and really think if this is a good direction or not :) I hope this makes scripting easier, and keeping a more focused "Unix" style of not being too chatty, rely on exit status etc. |
|
How about output errors to stderr instead? |
Yeah, well the idea is that cobra will decide on the errors (right now it will print to stderr). |
|
I'm feels like I'm missing some context, when do you get JSON from the CLI? There are still the tables with instances, plugins etc.? |
Yes it's a mix, but if we want it "scriptable" we need a consistent output format. Could be table (without headers) and/or JSON. Now it's a mix: Regardless of JSON/table we don't want any non-data text in stdout (stderr is fine, but also want to handle errors in a consistent manner) |
|
Oh TIL, I opened a bug for that: #22 I think everything should be nice human-readable output by default and that you should request the JSON output. |
Remove progress, success, and error messages from stdout. Commands now output only JSON or nothing, using exit codes for errors.