From 7f0333a19aed097a141538fa6e3c1fbb6f1a678b Mon Sep 17 00:00:00 2001 From: Sumit Arora Date: Thu, 9 Mar 2017 11:01:41 -0500 Subject: [PATCH] fix(@angular/cli): Fixing generate help command fix --- packages/@angular/cli/commands/generate.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@angular/cli/commands/generate.ts b/packages/@angular/cli/commands/generate.ts index ac3f3208d7b4..c0581c46c526 100644 --- a/packages/@angular/cli/commands/generate.ts +++ b/packages/@angular/cli/commands/generate.ts @@ -26,13 +26,13 @@ const GenerateCommand = EmberGenerateCommand.extend({ // map the blueprint name to allow for aliases rawArgs[0] = mapBlueprintName(rawArgs[0]); - if (rawArgs[0] !== '--help' && - !fs.existsSync(path.join(__dirname, '..', 'blueprints', rawArgs[0]))) { + const isHelp: boolean = ['--help', '-h'].indexOf(rawArgs[0]) > -1; + if (!isHelp && !fs.existsSync(path.join(__dirname, '..', 'blueprints', rawArgs[0]))) { SilentError.debugOrThrow('@angular/cli/commands/generate', `Invalid blueprint: ${rawArgs[0]}`); } - if (!rawArgs[1]) { + if (!isHelp && !rawArgs[1]) { SilentError.debugOrThrow('@angular/cli/commands/generate', `The \`ng generate ${rawArgs[0]}\` command requires a name to be specified.`); }