-
Notifications
You must be signed in to change notification settings - Fork 28
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
Conversation
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
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, 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) |
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.
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") |
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.
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") |
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.
should not be capitalized
} | ||
name := args[0] | ||
if name == "" { | ||
return errors.New("must specify topic name") | ||
return errors.New("Must specify topic name") |
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.
ditto
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.
@neha-viswanathan I agree with @ndegory. Looks good overall. Please make the requested changes and also resolve merge conflicts. Thanks.
bdc1a36
to
f2e9463
Compare
@ndegory I will add the Cobra Description to the root command as a different PR. |
@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 |
Fix for issues #547 #561 #565
amp --version
,amp -V
to only display amp versionTo test #547