Repository navigation
Overhaul flag and subcommand errors in kubectl-ate - #2547
Merged
Tim Hockin (thockin) merged 1 commit intoOct 15, 2026
Merged
Conversation
Julian Gutierrez Oschmann (juli4n)
previously approved these changes
Oct 13, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 13, 2026
Tim Hockin (thockin)
force-pushed
the
cli-input-errors
branch
from
October 14, 2026 00:31
463ee8b to
efda48d
Compare
Collaborator
Author
|
Rebased |
Tim Hockin (thockin)
force-pushed
the
cli-input-errors
branch
from
October 14, 2026 06:10
efda48d to
97d718a
Compare
Julian Gutierrez Oschmann (juli4n)
enabled auto-merge
October 14, 2026 15:26
Julian Gutierrez Oschmann (juli4n)
previously approved these changes
Oct 14, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 14, 2026
Tim Hockin (thockin)
force-pushed
the
cli-input-errors
branch
from
October 14, 2026 18:08
97d718a to
e182fa6
Compare
Previous to this errors might be helpful (dumping full help text) but
they might also be spartan:
```
$ kubectl-ate dasdsd
Error: unknown command "dasdsd" for "kubectl-ate"
Run 'kubectl-ate --help' for usage.
```
or they might be useless:
```
$ kubectl-ate -r
Error: unknown shorthand flag: 'r' in -r
```
Sometimes they used stdout, and sometimes stderr.
In short, Cobra's error handling is a mess. There are bazillions of
options and I could not find a combination that did something useful.
So now we take control ourselves. Every error should:
1) print an error message telling you what went wrong ("missing flag",
"unknown subcommand", etc)
2) dump the closest help message
3) write to stderr exclusively
This also cleans up flag descriptions.
Gemini helped.
Tim Hockin (thockin)
force-pushed
the
cli-input-errors
branch
from
October 15, 2026 03:53
e182fa6 to
189c2d8
Compare
Collaborator
Author
|
rebased and fixed (I think) |
Benjamin Elder (BenTheElder)
approved these changes
Oct 15, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previous to this errors might be helpful (dumping full help text) but they might also be spartan:
or they might be useless:
Sometimes they used stdout, and sometimes stderr.
In short, Cobra's error handling is a mess. There are bazillions of options and I could not find a combination that did something useful.
So now we take control ourselves. Every error should: 1) print an error message telling you what went wrong ("missing flag",
"unknown subcommand", etc)
2) dump the closest help message
3) write to stderr exclusively
This also cleans up flag descriptions.
Gemini helped.
Fixes #2463