-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Set proper default command output #8628
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]> Co-authored-by: Alessio Treglia <[email protected]> Co-authored-by: Amaury <[email protected]>
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/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes