Skip to content

Minor example edits#3

Merged
caarlos0 merged 2 commits intomainfrom
edit
Nov 27, 2024
Merged

Minor example edits#3
caarlos0 merged 2 commits intomainfrom
edit

Conversation

@meowgorithm
Copy link
Copy Markdown
Member

@meowgorithm meowgorithm commented Nov 26, 2024

Mostly just showing help by default.

Copy link
Copy Markdown
Member

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

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

this was more for testing than as an example per se, but lgtm :D

// Args: cobra.ArbitraryArgs,
Run: func(*cobra.Command, []string) {},
Run: func(*cobra.Command, []string) {
_ = cmd.Help()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe here do something like printing "running the program"?

if we were to show help by default, there's a cobra option for it 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's fair. I'll adjust!

@meowgorithm
Copy link
Copy Markdown
Member Author

meowgorithm commented Nov 26, 2024

Fwiw, I find examples very helpful in leaning how things work!

@caarlos0 caarlos0 merged commit 318d357 into main Nov 27, 2024
@caarlos0 caarlos0 deleted the edit branch November 27, 2024 12:25
@caarlos0 caarlos0 restored the edit branch November 27, 2024 12:41
@caarlos0 caarlos0 deleted the edit branch November 27, 2024 12:41
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