Skip to content

Commit

Permalink
fix: improve match threshold (react-native-community#1001)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 authored Feb 22, 2020
1 parent f1209fc commit 4212b93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function printHelpInformation(
function printUnknownCommand(cmdName: string) {
const availableCommands = commander.commands.map(cmd => cmd._name);
const suggestion = availableCommands.find(cmd => {
return leven(cmd, cmdName) < 3;
return leven(cmd, cmdName) < cmd.length * 0.4;
});
let errorMsg = `Unrecognized command "${chalk.bold(cmdName)}".`;
if (suggestion) {
Expand Down

0 comments on commit 4212b93

Please sign in to comment.