Set proper default command output#8628
Set proper default command output#8628mergify[bot] merged 13 commits intocosmos:masterfrom rmontagnin:command-outout-fix
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8628 +/- ##
==========================================
+ Coverage 58.79% 58.83% +0.03%
==========================================
Files 583 580 -3
Lines 32752 32636 -116
==========================================
- Hits 19257 19200 -57
+ Misses 11218 11170 -48
+ Partials 2277 2266 -11
|
amaury1093
left a comment
There was a problem hiding this comment.
lgtm, though I didn't test it. @RiccardoM did you test it locally on your machine?
Also, a changelog entry would be nice. I believe this is considered client-breaking.
Added the CHANGELOG entry. I also moved the place where the outputs were initialized cause it didn't work. The new method using the already existing |
alessio
left a comment
There was a problem hiding this comment.
Hold off please. Errors and diagnostics always go to stderr. When a command is meant to produce an output, that should go to stdout. Don't change defaults please.
Shouldn't this be a responsibility of commands? IMO they should call |
Yes, I agree. It makes sense. I agree with @alexanderbez, we need some grooming here. Just changing defaults seems the most obvious way to get the wrong solution in place. |
fix: groom all uses of cmd.Print*
|
It is unfortunate that this PR has not gained any traction. It is a major ergonomic failure (and violation of standard *nix pipelineable commands) to have machine-readable output go to stderr. If I run @alessio, what will it take to merge? |
I'm testing this again now. |
|
@RiccardoM mind resolving the conflicts, please? |
…tout-fix � Conflicts: � CHANGELOG.md � client/keys/migrate.go � simapp/simd/cmd/root.go
Should be done |
|
tACK. Tested with a couple of CLI subcommands outputting JSON, and piping to jq |
|
I believe backporting this could be useful for gaia CLI users. |
shahankhatch
left a comment
There was a problem hiding this comment.
Thanks! Very helpful for gaia users.
|
Thank you, everybody! |
* Set proper default command output * Removed duplicated cmd.SetErr(cmd.ErrOrStderr()) and cmd.SetOut(cmd.OutOrStdout()) * Moved command initialization and added CHANGELOG * fix: groom all uses of cmd.Print* * Ran make format Co-authored-by: Michael FIG <mfig@agoric.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
Description
This PR sets the proper default command output
closes: #8498
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/) or specification (x/<module>/spec/)godoccomments.Unreleasedsection inCHANGELOG.mdFiles changedin the Github PR explorerCodecov Reportin the comment section below once CI passes