-
Notifications
You must be signed in to change notification settings - Fork 263
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
Unkown subcommand doesn't return any errors #111
Milestone
Comments
navidshaikh
added a commit
to navidshaikh/client
that referenced
this issue
May 15, 2019
Fixes knative#111 ``` ➜ ./kn service list unknown command "list" for "kn service" ➜ echo $? 1 ➜ ./kn revision list unknown command "list" for "kn revision" ➜ echo $? 1 ```
Issue at spf13/cobra#706 |
We can easily fix this for all command grouped. I'll submit a PR and we can discuss details there. /assign @maximilien |
maximilien
added a commit
to maximilien/client
that referenced
this issue
Jun 18, 2019
…mmands ```bash ➜ client git:(issue111) ✗ ./kn service unknown unknown command "unknown" for "kn service" ``` This works for both the `service` and `revision` groups.
maximilien
added a commit
to maximilien/client
that referenced
this issue
Jun 19, 2019
…mmands ```bash ➜ client git:(issue111) ✗ ./kn service unknown unknown command "unknown" for "kn service" ➜ client git:(issue111) ✗ ./kn revision please provide a valid sub-command for "kn revision" ``` This works for both the `service` and `revision` groups.
maximilien
added a commit
to maximilien/client
that referenced
this issue
Jun 20, 2019
…mmands ```bash ➜ client git:(issue111) ✗ ./kn service unknown Service command group Usage: kn service [flags] kn service [command] Available Commands: create Create a service. delete Delete a service. describe Describe available services. list List available services. update Update a service. Flags: -h, --help help for service Global Flags: --kubeconfig string kubectl config file (default is $HOME/.kube/config) Use "kn service [command] --help" for more information about a command. unknown command "unknown" for "kn service" ➜ client git:(issue111) ✗ ./kn revision lol Revision command group Usage: kn revision [flags] kn revision [command] Available Commands: describe Describe revisions. list List available revisions. Flags: -h, --help help for revision Global Flags: --kubeconfig string kubectl config file (default is $HOME/.kube/config) Use "kn revision [command] --help" for more information about a command. unknown command "lol" for "kn revision" ``` This works for both the `service` and `revision` groups whe called with empty and unknown sub-command.
maximilien
added a commit
to maximilien/client
that referenced
this issue
Jul 1, 2019
…mmands ```bash ➜ client git:(issue111) ✗ ./kn service unknown Service command group Usage: kn service [flags] kn service [command] Available Commands: create Create a service. delete Delete a service. describe Describe available services. list List available services. update Update a service. Flags: -h, --help help for service Global Flags: --kubeconfig string kubectl config file (default is $HOME/.kube/config) Use "kn service [command] --help" for more information about a command. unknown command "unknown" for "kn service" ➜ client git:(issue111) ✗ ./kn revision lol Revision command group Usage: kn revision [flags] kn revision [command] Available Commands: describe Describe revisions. list List available revisions. Flags: -h, --help help for revision Global Flags: --kubeconfig string kubectl config file (default is $HOME/.kube/config) Use "kn revision [command] --help" for more information about a command. unknown command "lol" for "kn revision" ``` This works for both the `service` and `revision` groups whe called with empty and unknown sub-command.
maximilien
added a commit
to maximilien/client
that referenced
this issue
Jul 1, 2019
Explores all sub-commands from root and adds a RunE for all commands that are groups with child commands and without a RunE. The added RunE will return the correct errors when the command is called with empty sub-command or with an unknown sub-command. It will also print the command help message first.
maximilien
added a commit
to maximilien/client
that referenced
this issue
Jul 1, 2019
Explores all sub-commands from root and adds a RunE for all commands that are groups with child commands and without a RunE. The added RunE will return the correct errors when the command is called with empty sub-command or with an unknown sub-command. It will also print the command help message first.
maximilien
added a commit
to maximilien/client
that referenced
this issue
Jul 2, 2019
Explores all sub-commands from root and adds a RunE for all commands that are groups with child commands and without a RunE. The added RunE will return the correct errors when the command is called with empty sub-command or with an unknown sub-command. It will also print the command help message first.
maximilien
added a commit
to maximilien/client
that referenced
this issue
Jul 2, 2019
Explores all sub-commands from root and adds a RunE for all commands that are groups with child commands and without a RunE. The added RunE will return the correct errors when the command is called with empty sub-command or with an unknown sub-command. It will also print the command help message first.
maximilien
added a commit
to maximilien/client
that referenced
this issue
Jul 2, 2019
Explores all sub-commands from root and adds a RunE for all commands that are groups with child commands and without a RunE. The added RunE will return the correct errors when the command is called with empty sub-command or with an unknown sub-command. It will also print the command help message first.
maximilien
added a commit
to maximilien/client
that referenced
this issue
Jul 2, 2019
Explores all sub-commands from root and adds a RunE for all commands that are groups with child commands and without a RunE. The added RunE will return the correct errors when the command is called with empty sub-command or with an unknown sub-command. It will also print the command help message first. Added a gotest.tools test for root.go.
maximilien
added a commit
to maximilien/client
that referenced
this issue
Jul 2, 2019
Explores all sub-commands from root and adds a RunE for all commands that are groups with child commands and without a RunE. The added RunE will return the correct errors when the command is called with empty sub-command or with an unknown sub-command. It will also print the command help message first. Added a gotest.tools test for root.go.
maximilien
added a commit
to maximilien/client
that referenced
this issue
Jul 2, 2019
Explores all sub-commands from root and adds a RunE for all commands that are groups with child commands and without a RunE. The added RunE will return the correct errors when the command is called with empty sub-command or with an unknown sub-command. It will also print the command help message first. Added a gotest.tools test for root.go.
maximilien
added a commit
to maximilien/client
that referenced
this issue
Jul 3, 2019
Explores all sub-commands from root and adds a RunE for all commands that are groups with child commands and without a RunE. The added RunE will return the correct errors when the command is called with empty sub-command or with an unknown sub-command. It will also print the command help message first. Added a gotest.tools test for root.go.
maximilien
added a commit
to maximilien/client
that referenced
this issue
Jul 3, 2019
Explores all sub-commands from root and adds a RunE for all commands that are groups with child commands and without a RunE. The added RunE will return the correct errors when the command is called with empty sub-command or with an unknown sub-command. It will also print the command help message first. Added a gotest.tools test for root.go.
knative-prow-robot
pushed a commit
that referenced
this issue
Jul 3, 2019
Explores all sub-commands from root and adds a RunE for all commands that are groups with child commands and without a RunE. The added RunE will return the correct errors when the command is called with empty sub-command or with an unknown sub-command. It will also print the command help message first. Added a gotest.tools test for root.go.
Fixed by #218 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For example, we've renamed
kn service list
->kn service get
, however if ranlist
, it just shows thehelp
text forservice
group and doesn't return with exit status 1 or prints thatlist
is unkown command.This seems to be a known inconsistency with only sub-commands and not with commands.
However, we've a false positive https://github.com/knative/client/blob/master/test/e2e-tests.sh#L50 .
The text was updated successfully, but these errors were encountered: