Skip to content

Commit

Permalink
fix(CLI): Fix resolution of help for not integrated commands
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Oct 21, 2021
1 parent 2d6740e commit 204f205
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/serverless.js
Expand Up @@ -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) {
Expand Down
8 changes: 8 additions & 0 deletions test/unit/scripts/serverless.test.js
Expand Up @@ -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
Expand Down

0 comments on commit 204f205

Please sign in to comment.