You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
It might be a good idea to generate output for the gobl keygen command that indicates what files have been generated, and where.
Does it make sense to write message to STDERR incase STDOUT is being used to pipe a generated key (perhaps?) A -v tag for verbose output might be a good idea.
The text was updated successfully, but these errors were encountered:
I think this type of thing requires some thought, as there are several ways to do something like this.
For this particular feature, what probably makes sense to me is outputting helpful info to STDOUT except when STDOUT is being used as the output location of the key (in which case the helpful output isn't helpful anyway), or when quiet mode (i.e. --quiet?) is on (i.e for scripting purposes).
I expect there are output situations not covered by that, though.
I think for this application where STDOUT is likely to be used for data output its acceptable to use STDERR for all logging, as a rule. Sending to STDERR requires more effort, hence why it's not so common, but I don't think it's bad practice.
If a logging library is used, then it should be easy to add a --quiet option too.
It occurred to me that perhaps an alternate solution would be to always generate JSON output and make sure that the exit status code is non-zero. If you're worried about script handling, this would solve the problem and provide a universal interface with comparable results in both CLI and HTTP.
Argument errors, i.e. stuff caught by cobra, should be sent to STDERR as this clearly reflects invalid usage and you wouldn't want those to be scriptable.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It might be a good idea to generate output for the
gobl keygen
command that indicates what files have been generated, and where.Does it make sense to write message to STDERR incase STDOUT is being used to pipe a generated key (perhaps?) A
-v
tag for verbose output might be a good idea.The text was updated successfully, but these errors were encountered: