Skip to content

Create separate subcmds for get #148

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

Merged
merged 5 commits into from
Sep 13, 2023
Merged

Conversation

petedannemann
Copy link
Contributor

@petedannemann petedannemann commented Sep 12, 2023

In order to make topicctl get more flexible in future work, this PR breaks the topicctl get subcommands into proper Cobra subcommands. This allows them to be configured individually and will open up the possibility of custom flags for each. The functionally of them is equivalent, but they now have descriptions.

These commands are not under automated tests so I functionally tested several of them commands side by side with the old implementation and the output looked the same as before

@@ -38,109 +32,249 @@ type getCmdConfig struct {
var getConfig getCmdConfig

func init() {
getCmd.Flags().BoolVar(
getCmd.PersistentFlags().BoolVar(
Copy link
Contributor Author

@petedannemann petedannemann Sep 12, 2023

Choose a reason for hiding this comment

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

PersistentFlags allow us to pass these flags through from the parent command (get) to all the child commands

@petedannemann petedannemann marked this pull request as ready for review September 12, 2023 19:13
@petedannemann petedannemann requested a review from a team as a code owner September 12, 2023 19:13
Copy link
Contributor

@hhahn-tw hhahn-tw left a comment

Choose a reason for hiding this comment

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

Looks good!

@petedannemann petedannemann merged commit 7ac2269 into master Sep 13, 2023
@petedannemann petedannemann deleted the chore/separate-subcmd-for-get branch September 13, 2023 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants