-
Notifications
You must be signed in to change notification settings - Fork 242
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
When typing odo foobar --help should error out with invalid command #5813
Conversation
✅ Deploy Preview for odo-docusaurus-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: valaparthvi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pkg/odo/cli/cli.go
Outdated
rootCmd.SetHelpFunc(func(command *cobra.Command, args []string) { | ||
// Simple way of checking to see if the command has a parent (if it doesn't, it does not exist) | ||
if !command.HasParent() && len(args) > 0 { | ||
fmt.Printf("unknown command '%s', type --help for a list of all commands\n", args[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should print in stderr instead
<!-- Thank you for opening a PR! Here are some things you need to know before submitting: 1. Please read our developer guideline: https://github.com/redhat-developer/odo/wiki/Dev:-odo-Dev-Guidelines 2. Label this PR accordingly with the '/kind' line 3. Ensure you have written and ran the appropriate tests: https://github.com/redhat-developer/odo/wiki/Dev:-Writing-and-running-tests 4. Read how we approve and LGTM each PR: https://github.com/redhat-developer/odo/wiki/Pull-Requests:-Review-guideline Documentation: If you are pushing a change to documentation, please read: https://github.com/redhat-developer/odo/wiki/Documentation:-Contributing --> **What type of PR is this:** <!-- Add one of the following kinds: /kind feature /kind cleanup /kind tests /kind documentation Feel free to use other [labels](https://github.com/redhat-developer/odo/labels) as needed. However one of the above labels must be present or the PR will not be reviewed. This instruction is for reviewers as well. --> /kind bug **What does this PR do / why we need it:** When we type: ```sh odo foobar --help ``` We should error out that it's an invalid command. **Which issue(s) this PR fixes:** <!-- Specifying the issue will automatically close it when this PR is merged --> Fixes redhat-developer#5439 **PR acceptance criteria:** - [X] Integration test **How to test changes / Special notes to the reviewer:** Signed-off-by: Charlie Drage <[email protected]>
Kudos, SonarCloud Quality Gate passed!
|
/lgtm /override ci/prow/unit |
@feloy: Overrode contexts on behalf of feloy: ci/prow/unit, ci/prow/v4.10-integration-e2e In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
…edhat-developer#5813) * When typing odo foobar --help should error out with invalid command <!-- Thank you for opening a PR! Here are some things you need to know before submitting: 1. Please read our developer guideline: https://github.com/redhat-developer/odo/wiki/Dev:-odo-Dev-Guidelines 2. Label this PR accordingly with the '/kind' line 3. Ensure you have written and ran the appropriate tests: https://github.com/redhat-developer/odo/wiki/Dev:-Writing-and-running-tests 4. Read how we approve and LGTM each PR: https://github.com/redhat-developer/odo/wiki/Pull-Requests:-Review-guideline Documentation: If you are pushing a change to documentation, please read: https://github.com/redhat-developer/odo/wiki/Documentation:-Contributing --> **What type of PR is this:** <!-- Add one of the following kinds: /kind feature /kind cleanup /kind tests /kind documentation Feel free to use other [labels](https://github.com/redhat-developer/odo/labels) as needed. However one of the above labels must be present or the PR will not be reviewed. This instruction is for reviewers as well. --> /kind bug **What does this PR do / why we need it:** When we type: ```sh odo foobar --help ``` We should error out that it's an invalid command. **Which issue(s) this PR fixes:** <!-- Specifying the issue will automatically close it when this PR is merged --> Fixes redhat-developer#5439 **PR acceptance criteria:** - [X] Integration test **How to test changes / Special notes to the reviewer:** Signed-off-by: Charlie Drage <[email protected]> * Send message to stderr
What type of PR is this:
/kind bug
What does this PR do / why we need it:
When we type:
We should error out that it's an invalid command.
Which issue(s) this PR fixes:
Fixes #5439
PR acceptance criteria:
How to test changes / Special notes to the reviewer:
Signed-off-by: Charlie Drage [email protected]