Skip to content
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

Merged
merged 2 commits into from
Oct 8, 2018

Conversation

BenTheElder
Copy link
Member

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!

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 8, 2018
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 8, 2018
Copy link
Contributor

@amwat amwat left a 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)
Copy link
Contributor

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?

Copy link
Member Author

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

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Oct 8, 2018
@BenTheElder
Copy link
Member Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 8, 2018
@k8s-ci-robot k8s-ci-robot merged commit 9bdf57f into kubernetes-sigs:master Oct 8, 2018
@BenTheElder BenTheElder deleted the breaking-cli branch October 8, 2018 21:00
@BenTheElder BenTheElder added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

normalize CLI
3 participants