Skip to content
This repository has been archived by the owner on Aug 27, 2019. It is now read-only.

Add support for bash completions #9

Merged
merged 1 commit into from May 8, 2019
Merged

Add support for bash completions #9

merged 1 commit into from May 8, 2019

Conversation

cblecker
Copy link
Contributor

@cblecker cblecker commented May 8, 2019

No description provided.

Copy link
Collaborator

@jhernand jhernand left a comment

Choose a reason for hiding this comment

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

Thanks @cblecker, very nice addition. Just a minor comment about moving the new command to its own package. Once you do that I will merge and make a new release.

cmd/uhc/main.go Outdated
@@ -63,6 +63,7 @@ func init() {
root.AddCommand(token.Cmd)
root.AddCommand(version.Cmd)
root.AddCommand(cluster.Cmd)
root.AddCommand(completionCmd)
Copy link
Collaborator

Choose a reason for hiding this comment

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

All the other commands in the CLI live in their own package. Can you do the same for this one? Create a new cmd/uhc/completion directory and put the code there. Then this will be root.AddCommand(completion.Cmd).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't easily done, as I need to refer back to the top-level command (root): https://github.com/openshift-online/uhc-cli/pull/9/files#diff-7e01ad4f5f72c98103727d222dba6a64R42

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can do cmd.Root()....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the tip! Fixed.

@@ -0,0 +1,47 @@
/*
Copyright (c) 2018 Red Hat, Inc.
Copy link
Collaborator

Choose a reason for hiding this comment

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

2019

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

@jhernand
Copy link
Collaborator

jhernand commented May 8, 2019

Thanks @cblecker, looks good, I am merging.

@jhernand jhernand merged commit 903c0d1 into openshift-online:master May 8, 2019
@cblecker cblecker deleted the completions branch May 8, 2019 16:57
@jhernand
Copy link
Collaborator

jhernand commented May 8, 2019

@cblecker your change is included in release 0.1.11.

@cblecker
Copy link
Contributor Author

cblecker commented May 8, 2019

Thanks @jhernand!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants