diff --git a/src/program.js b/src/program.js index 865c136ec9..dd99af5fcf 100644 --- a/src/program.js +++ b/src/program.js @@ -323,7 +323,8 @@ Example: $0 --help run. .env(envPrefix) .version(version) .demandCommand(1, 'You must specify a command') - .strict(); + .strict() + .recommendCommands(); program.setGlobalOptions({ 'source-dir': { diff --git a/tests/functional/test.typo.run.js b/tests/functional/test.typo.run.js new file mode 100644 index 0000000000..9a6132f95c --- /dev/null +++ b/tests/functional/test.typo.run.js @@ -0,0 +1,16 @@ +/* @flow */ +import {describe, it} from 'mocha'; +import {assert} from 'chai'; + +import {execWebExt} from './common'; + +describe('web-ext', () => { + it('recommends matching command', async () => { + const argv = ['buld']; + + return execWebExt(argv, {}).waitForExit.then(({exitCode, stderr}) => { + assert.notEqual(exitCode, 0); + assert.match(stderr, /Did you mean build/); + }); + }); +}); \ No newline at end of file