diff --git a/scripts/serverless.js b/scripts/serverless.js index 7d52890a45e..ff89beab7b1 100755 --- a/scripts/serverless.js +++ b/scripts/serverless.js @@ -513,7 +513,7 @@ const processSpanPromise = (async () => { const isStandaloneCommand = notIntegratedCommands.has(command); - if (isInteractiveSetup || isStandaloneCommand) { + if (!isHelpRequest && (isInteractiveSetup || isStandaloneCommand)) { if (configuration) require('../lib/cli/ensure-supported-command')(configuration); if (isInteractiveSetup) { if (!process.stdin.isTTY && !process.env.SLS_INTERACTIVE_SETUP_ENABLE) { diff --git a/test/unit/scripts/serverless.test.js b/test/unit/scripts/serverless.test.js index 89e711a0b73..064afd69de7 100644 --- a/test/unit/scripts/serverless.test.js +++ b/test/unit/scripts/serverless.test.js @@ -236,6 +236,14 @@ describe('test/unit/scripts/serverless.test.js', () => { expect(output).to.include('stage'); }); + it('should print not integrated command --help to stdout', async () => { + const output = String( + (await spawn('node', [serverlessPath, 'plugin', 'install', '--help'])).stdoutBuffer + ); + expect(output).to.include('plugin install'); + expect(output).to.include('stage'); + }); + it('should print interactive setup help to stdout', async () => { const output = String( (await spawn('node', [serverlessPath, '--help-interactive'])).stdoutBuffer