fix(core): generic solution for issue #111 for all command groups#218
fix(core): generic solution for issue #111 for all command groups#218knative-prow-robot merged 1 commit intoknative:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maximilien The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/assign @cppforlife cc: @rhuss |
There was a problem hiding this comment.
Works better than v1 fix of the issue.
@maximilien :
- Can we separate the help section and error message printed with a line please? helps make error message more visible / readable.
- I tested PR by running
./hack/build.sh, its reporting updates to command docs filesdocs/cmd/kn_revision.mdanddocs/cmd/kn_service.mdas well, lets also include that with the PR. - Can we add some tests please?
I think @maximilien wants just to wait with tests until with which testing setup we want to continue. So let's wait until tomorrows WG meeting. |
bc3484e to
0abdb7d
Compare
97bd1b4 to
bba7abb
Compare
|
OK @rhuss, I think I am convinced I added a test for cc: @navidshaikh and @cppforlife |
0c2141a to
8db55d0
Compare
|
@maximilien I think you missed to check in the vendored files (use a The PR looks good to me, let's merge it tomorrow if there are no objections against gotest.tools in today's WG call. |
Yes, done, thanks @rhuss, one day I will remember to do this before pushing :) Converting all ginkgo tests now. Best. |
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.
|
The following is the coverage report on pkg/.
|
|
/lgtm |
|
@maximilien cool, thanks ! Now that gotest.tools is in, we have to rebase our other PRs which introduce them (but should be hopefully trivial) |
BFS exploration of all sub-commands from
rootCmdand adds aRunEfor all commands that are command groups with child sub-commands and without aRunE.The added
RunEwill 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.I did not add a test for this since the we need to decide on #185 and #214 and #134. Once we do I will add the gotest.tools or Ginkgo test for it.