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

amp flags --version, -V function correctly #589

Merged
merged 2 commits into from
Dec 16, 2016
Merged

amp flags --version, -V function correctly #589

merged 2 commits into from
Dec 16, 2016

Conversation

neha-viswanathan
Copy link
Contributor

@neha-viswanathan neha-viswanathan commented Dec 14, 2016

Fix for issues #547 #561 #565

  • Fixed amp --version, amp -V to only display amp version
  • Formatted help descriptions
  • Formatted amplifier flags to lowercase

To test #547

$ make install
$ amp --version
amp (cli version: v0.4.0-dev, build: bdc1a369)
$ amp -V
amp (cli version: v0.4.0-dev, build: bdc1a369)

Copy link
Contributor

@JosephGJ JosephGJ left a comment

Choose a reason for hiding this comment

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

LGTM

@neha-viswanathan neha-viswanathan changed the title amp version functions correctly amp flags --version, -V function correctly Dec 15, 2016
@ndegory ndegory added this to the 0.4.0 milestone Dec 15, 2016
Copy link
Contributor

@ndegory ndegory left a comment

Choose a reason for hiding this comment

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

LGTM, with requested changes. Also, we should probably add a Long Cobra description to the RootCmd, but that means changing the usage template in main.go.

@@ -87,7 +87,7 @@ func (s *ampManager) init(firstMessage string) error {
defaultHeaders := map[string]string{"User-Agent": "amplifier"}
cli, err := client.NewClient(DockerURL, DockerVersion, nil, defaultHeaders)
if err != nil {
return fmt.Errorf("impossible to connect to Docker on: %s\n%v", DockerURL, err)
return fmt.Errorf("Impossible to connect to Docker on: %s\n%v", DockerURL, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Error message should not be capitalized. A PR is waiting to be merged with same kind of warnings: #545

@@ -94,7 +94,7 @@ func RegistryPush(amp *client.AMP, cmd *cobra.Command, args []string) error {
return fmt.Errorf("Error parsing reference: %q is not a valid repository/tag", image)
}
if _, isCanonical := distributionRef.(distreference.Canonical); isCanonical {
return errors.New("refusing to create a tag with a digest reference")
return errors.New("Refusing to create a tag with a digest reference")
Copy link
Contributor

Choose a reason for hiding this comment

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

should not be capitalized

@@ -27,11 +27,11 @@ func init() {

func createTopic(amp *client.AMP, cmd *cobra.Command, args []string) error {
if len(args) == 0 {
return errors.New("must specify topic name")
return errors.New("Must specify topic name")
Copy link
Contributor

Choose a reason for hiding this comment

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

should not be capitalized

}
name := args[0]
if name == "" {
return errors.New("must specify topic name")
return errors.New("Must specify topic name")
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor

@subfuzion subfuzion left a comment

Choose a reason for hiding this comment

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

@neha-viswanathan I agree with @ndegory. Looks good overall. Please make the requested changes and also resolve merge conflicts. Thanks.

@neha-viswanathan
Copy link
Contributor Author

@ndegory I will add the Cobra Description to the root command as a different PR.

@subfuzion subfuzion merged commit a501e3e into master Dec 16, 2016
@subfuzion subfuzion deleted the amp-version branch December 16, 2016 19:09
@ndegory
Copy link
Contributor

ndegory commented Dec 19, 2016

@neha-viswanathan there's an issue with this PR (already merged), previous commits (at least a part of #592) have been reverted. I noticed it with the output of amp config.
I think you should revert it, restore the branch, and rebase it from master.

@subfuzion subfuzion restored the amp-version branch December 19, 2016 17:21
@subfuzion subfuzion mentioned this pull request Dec 19, 2016
@JosephGJ JosephGJ deleted the amp-version branch December 21, 2016 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants