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

Show help for default command #953

Merged

Conversation

krisrok
Copy link
Contributor

@krisrok krisrok commented Sep 7, 2022

As mentioned in #951 (and #702)

When called without args:

  • Default command with required params -> Show help
  • Default command with required params and additional commands -> Show help including additional commands
  • Default command without required params -> Execute command

Note: I wasn't too sure about the return code of 1 when displaying help as no error gets displayed. How is this handled in other applications where calling it without args is also displaying the help?

Shows help if the default command was called without any arguments but has required arguments.
This way it does not hinder execution of a default command without any required arguments.
Make sure default command's help is displayed correctly.

When called without args:
- Default command with required params -> Show help
- Default command with required params and additional commands -> Show help including additional commands
- Default command without required params -> Execute command
@FrankRay78
Copy link
Contributor

Thank you for your contribution @krisrok, just to let you know that I intend to review this PR over the coming weeks.

@dnfadmin
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

❌ krisrok sign now
You have signed the CLA already but the status is still pending? Let us recheck it.

@FrankRay78 FrankRay78 linked an issue Dec 14, 2022 that may be closed by this pull request
@FrankRay78 FrankRay78 merged commit 4a8a4ab into spectreconsole:main Dec 14, 2022
@FrankRay78
Copy link
Contributor

Thank you @krisrok, all merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Automatically showing help using default command
3 participants