Skip to content
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

feat(cli): add suggestions for missing or incorrect resource #2999

Merged
merged 1 commit into from Jul 28, 2023

Conversation

schoren
Copy link
Collaborator

@schoren schoren commented Jul 28, 2023

This PR adds suggestions when the resource is missing or misspelled for resource commands.

Examples:

  1. Missing resource:
    Screenshot 2023-07-28 at 12 50 14

  2. Misspelled resource
    Screenshot 2023-07-28 at 12 50 25

Changes

Fixes

Checklist

  • tested locally
  • added new dependencies
  • updated the docs
  • added a test


const minDistanceForSuggestion = 2

func (r *Registry) Suggest(input string) string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fancy 💅🏾

@schoren schoren merged commit 3428147 into main Jul 28, 2023
30 checks passed
@schoren schoren deleted the cli-show-resources branch July 28, 2023 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Available resource names should be returned on CLI when missing
4 participants