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): recommend matching commands #3700

Merged
merged 2 commits into from
Feb 1, 2020

Conversation

jamesgeorge007
Copy link
Contributor

  • Type of contribution: feature

yargs provides out of the box support to help out the users if they mistype a command.

@jamesgeorge007
Copy link
Contributor Author

jamesgeorge007 commented Jan 14, 2020

Not sure what leads to the CI failure 🤔

It works like a charm on my local machine though:-
Screenshot from 2020-01-14 15-27-30

@gantoine
Copy link
Member

gantoine commented Jan 25, 2020

Neat! What does that look like with yargs? Does it auto-guess the right command, or output Did you mean xxxx?

For reference, the error in Travis is Cannot call commands.reduce(...).demand(...).strict().recommendCommands because property recommendCommands is missing in Yargs [1].

@jamesgeorge007
Copy link
Contributor Author

Neat! What does that look like with yargs? Does it auto-guess the right command, or output Did you mean xxxx?

For reference, the error in Travis is Cannot call commands.reduce(...).demand(...).strict().recommendCommands because property recommendCommands is missing in Yargs [1].

#3700 (comment)

@jamesgeorge007 jamesgeorge007 requested review from gantoine and removed request for gantoine January 26, 2020 15:22
@valscion
Copy link
Contributor

@jamesgeorge007 the error you're seeing is due to the recommendedCommands not being there in the yargs types 😄 https://github.com/flow-typed/flow-typed/blob/9facc3c967bb79251450f84e94746d7a71b526fd/definitions/npm/yargs_v4.x.x/flow_v0.104.x-/yargs_v4.x.x.js

Note that flow-typed CLI uses the types that are in this folder: https://github.com/flow-typed/flow-typed/tree/master/cli/flow-typed

@gantoine
Copy link
Member

My bad, missed that the first time around! So I guess the types in the folder used by the CLI need to be updated as well, as part of this PR. I'm going to assume the current definition for yargs includes those changes(?), and can probably be copied in.

@jamesgeorge007 jamesgeorge007 removed the request for review from AndrewSouthpaw January 27, 2020 17:34
@gantoine gantoine added the cli Related to CLI tool label Jan 27, 2020
@gantoine gantoine self-assigned this Jan 27, 2020
@pascalduez pascalduez merged commit f3fc9f1 into flow-typed:master Feb 1, 2020
@jamesgeorge007 jamesgeorge007 deleted the feat/suggest-cmd branch February 1, 2020 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to CLI tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants