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

Add CLI prints for successful operations #974

Merged
merged 1 commit into from
Sep 23, 2016
Merged

Conversation

riyazdf
Copy link
Contributor

@riyazdf riyazdf commented Sep 22, 2016

Add messages for successful CLI operations, such as publish (and -p), delete, and key rotate

Closes #973

Signed-off-by: Riyaz Faizullabhoy [email protected]

Copy link
Contributor

@endophage endophage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@cyli cyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for fixing this so quickly!

if t.deleteRemote {
rt, err = getTransport(config, gun, admin)
if err != nil {
return err
}
remoteDeleteInfo = " and remote"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Awesome letting them know they got the remote too!

}
return cl.Remove(t.deleteIdx)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally non-blocking stylistic nitpick: you could also do:

if err == nil {
   cmd.Printf("...")
}
return err

Which saves one return, and may make it clearer we are doing this because we want to log a success message.

// If it was a success, print to terminal and return nil
if err == nil {
cmd.Printf("Successfully reset specified changes for repository %s\n", gun)
return nil
Copy link
Contributor

@HuKeping HuKeping Sep 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this line could be removed? If so the comment at line 632 should be updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely could, it's surprising that govet/ineffassign don't seem to care about this. I do like how it's explicit but I'll remove this line 👍

@riyazdf riyazdf merged commit 0618825 into hotfix/0.4.1 Sep 23, 2016
@riyazdf riyazdf deleted the success-msg-cli branch September 23, 2016 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants