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.`); }