-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
switch cli to kind verb noun #59
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
9c6ee2d
to
57da2c2
Compare
57da2c2
to
92278cc
Compare
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
/hold
@@ -54,6 +56,7 @@ func Main() { | |||
TimestampFormat: "0102-15:04:05", | |||
}) | |||
if err := Run(); err != nil { | |||
log.Fatal(err) | |||
os.Stderr.WriteString(err.Error()) | |||
os.Exit(-1) |
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.
Why the switch from log.fatal?
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.
part of #23, cli tools should print an error to stdout and exit non-zero instead of FATA ....
... I'm going to reserve logging for actual debug info soon and use println and friends for actual user oriented output.
failing to run needs to be user oriented rather than logging. if this were eg a server I'd still do fatal
/hold cancel |
fixes #56
also starts to switch cobra commands to RunE instead of Run, which will let us test them with mocking better later, instead of calling fatal within the commands.
I'll follow up with volume fixes, the debug command, and logging cleanup soon!