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: Add "did you mean" CLI command name suggestions #7932

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

WillDaSilva
Copy link
Member

$ meltano initialize
Usage: meltano [OPTIONS] COMMAND [ARGS]...
Try 'meltano --help' for help.

Error: No such command 'initialize'.

Did you mean one of these?
    install
    init
$ meltano job ls
Usage: meltano job [OPTIONS] COMMAND [ARGS]...
Try 'meltano job --help' for help.

Error: No such command 'ls'.

Did you mean one of these?
    list

We can fine-tune how close an attempted command name must be to a real one for it to match. Currently the default cutoff of 0.5 is used.

Supporting this in the Cloud CLI will require editing one more line of code, which I'll do in when I merge main into cloud with these changes.

Closes #7425

@WillDaSilva WillDaSilva self-assigned this Jul 21, 2023
@netlify
Copy link

netlify bot commented Jul 21, 2023

Deploy Preview for meltano canceled.

Name Link
🔨 Latest commit ccfb46f
🔍 Latest deploy log https://app.netlify.com/sites/meltano/deploys/64ba7758570ad70008357ba2

@WillDaSilva WillDaSilva marked this pull request as ready for review July 21, 2023 12:35
@WillDaSilva WillDaSilva requested a review from a team as a code owner July 21, 2023 12:35
@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Merging #7932 (ccfb46f) into main (50dcd2a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #7932   +/-   ##
=======================================
  Coverage   89.47%   89.47%           
=======================================
  Files         295      295           
  Lines       21781    21782    +1     
  Branches     2439     2439           
=======================================
+ Hits        19488    19489    +1     
  Misses       1937     1937           
  Partials      356      356           
Impacted Files Coverage Δ
src/meltano/cli/utils.py 89.75% <100.00%> (+0.04%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@WillDaSilva WillDaSilva merged commit dbc19f3 into main Jul 21, 2023
44 checks passed
@WillDaSilva WillDaSilva deleted the 7425-click-did-you-mean branch July 21, 2023 15:10
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.

CLI: "Did you mean?" prompt if command doesn't exist
3 participants