refactor: inline approach
This commit is contained in:
parent
e287784228
commit
2dec836b11
1 changed files with 1 additions and 3 deletions
|
@ -138,9 +138,7 @@ module.exports = function (argv: string[]): void {
|
|||
.command('*', '', { noHelp: true })
|
||||
.action((cmd: string) => {
|
||||
program.help(help => {
|
||||
const suggestion = program.commands.map(c => c._name).find(c => {
|
||||
return leven(c, cmd) < c.length * 0.4;
|
||||
});
|
||||
const suggestion = program.commands.map(c => c._name).find(c => leven(c, cmd) < c.length * 0.4);
|
||||
|
||||
help = `${help}
|
||||
Unknown command '${cmd}'`;
|
||||
|
|
Loading…
Add table
Reference in a new issue