Fix output usage for flux get <sources|images>
#2347
Merged
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.
Fixes #2346
Background:
Cobra will automatically print Usage for commands that do not have a
.RunE
.All of the
flux get
command tree (including theflux get
root) have--watch/-w
registered as a PersistentFlag.
The
validateWatchOption()
func is used to short circuit runnable sub-commands thatoperate on multiple kinds, since the watch is not designed to stream/output multiple GVK's.
Justification:
These commands are runnable and need filtering:
flux get all
flux get sources all
flux get images all
These commands are not runnable, so there should be no
RunE
at all:flux get sources
flux get images
Current Bug/Inconsistency:
however:
Result of this patch:
ps:
I miss you nerds
much love from the tanzu team