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

Display custom command usage when it has no step #264

Merged
merged 2 commits into from Nov 28, 2022

Conversation

stoned
Copy link
Contributor

@stoned stoned commented Nov 26, 2022

what

  • When a custom command without steps is invoked without subcommand display its usage message.

why

  • When custom command without steps is invoked without subcommand, 'atmos' outputs nothing and simply exits. It could be helpful to display a usage message and exit without error, like when it is invoked without any argument (like 'atmos') or a toplevel command without required argument is invoked without a subcommand (like 'atmos aws' or 'atmos describe')

Use a Cobra PreRun function to end or abort a custom command when its
invocation is incorrect or incomplete.
@stoned stoned requested review from a team as code owners November 26, 2022 18:27
Copy link
Member

@aknysh aknysh left a comment

Choose a reason for hiding this comment

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

thanks again @stoned

@aknysh aknysh merged commit a817870 into cloudposse:master Nov 28, 2022
@stoned stoned deleted the cmd-check-subcmd branch January 1, 2023 14:04
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.

None yet

2 participants