-
Notifications
You must be signed in to change notification settings - Fork 111
feat(cli): notify when a flag is wrong and suggest a fix MCP-121 #517
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
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good 💯 Left a suggestion for the type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the CLI argument validation by adding functionality to detect invalid command line flags and suggest correct alternatives when users make typos. The implementation uses Levenshtein distance to find the closest valid flag names and provides helpful error messages.
- Adds new validation function
validateConfigKey
that checks for valid CLI arguments and suggests corrections - Enhances the existing deprecated argument warning system to also handle unknown/invalid arguments
- Integrates the fast-levenshtein library for fuzzy string matching to suggest corrections
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/common/config.ts | Implements CLI argument validation with typo detection and suggestion logic using Levenshtein distance |
tests/unit/common/config.test.ts | Updates test suite to cover new invalid argument detection and suggestion functionality |
package.json | Adds fast-levenshtein dependency and its TypeScript types for string similarity calculations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Pull Request Test Coverage Report for Build 17487477238Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Proposed changes
Checklist