[CLI-1454] Modify potentially misleading flag suggestions#1482
Merged
Steven Gagniere (sgagniere) merged 3 commits intomainfrom Oct 26, 2022
Merged
[CLI-1454] Modify potentially misleading flag suggestions#1482Steven Gagniere (sgagniere) merged 3 commits intomainfrom
Steven Gagniere (sgagniere) merged 3 commits intomainfrom
Conversation
Brian Strauch (brianstrauch)
approved these changes
Oct 26, 2022
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.
Checklist
What
Trying to run
api-key store x xwithout an active cluster and without the--resourceflag gives a suggestion to pass--clusteror--resource, but--clusteris not an allowed flag for this command.I've modified
api-key storeto discard the error fromGetKafkaClusterForCommand()and instead return an error with a suggestion tailored to this command (which was already being used further down).On a survey of
kafka,connect,ksqlandpipelinecommands, which all have the potential to see this same error message, none of them as far as I can tell accept--resourceas a valid flag, so the suggestion is also misleading for these commands and their subcommands.Based on that, I've changed the suggestion back to a previous version which only suggested the
--clusterflag. Otherapi-keycommands either have--resourcemarked asREQUIREDor else don't need a resource or cluster, so this shouldn't result in more misleading errors.References
https://confluentinc.atlassian.net/browse/CLI-1454
Test & Review
Tested manually and ran all tests