From f2086cc1cdbba12cd4e7e5be630884318b2d57a1 Mon Sep 17 00:00:00 2001 From: Mike Brocchi Date: Sun, 9 Oct 2016 21:44:47 -0400 Subject: [PATCH] bug(help): show correct listing of blueprints for generate help (#2580) Fixes #2300 --- packages/angular-cli/commands/generate.ts | 1 + packages/angular-cli/commands/help.ts | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/angular-cli/commands/generate.ts b/packages/angular-cli/commands/generate.ts index 789c15a89e9a..c3452c4d6db5 100644 --- a/packages/angular-cli/commands/generate.ts +++ b/packages/angular-cli/commands/generate.ts @@ -30,6 +30,7 @@ const GenerateCommand = EmberGenerateCommand.extend({ const blueprints = blueprintList .filter(bp => bp.indexOf('-test') === -1) .filter(bp => bp !== 'ng2') + .filter(bp => bp !== 'mobile') .map(bp => Blueprint.load(path.join(__dirname, '..', 'blueprints', bp))); let output = ''; diff --git a/packages/angular-cli/commands/help.ts b/packages/angular-cli/commands/help.ts index 85d42bc12c6d..c2a64771a183 100644 --- a/packages/angular-cli/commands/help.ts +++ b/packages/angular-cli/commands/help.ts @@ -17,7 +17,7 @@ const HelpCommand = Command.extend({ availableOptions: [], - run: function (commandOptions: any) { + run: function (commandOptions: any, rawArgs: any) { let commandFiles = fs.readdirSync(__dirname) // Remove files that are not JavaScript or Typescript .filter(file => file.match(/\.(j|t)s$/) && !file.match(/\.d.ts$/)) @@ -47,7 +47,14 @@ const HelpCommand = Command.extend({ tasks: this.tasks }); - this.ui.writeLine(command.printBasicHelp(commandOptions)); + if (rawArgs.length > 0) { + if (cmd === rawArgs[0]) { + this.ui.writeLine(command.printDetailedHelp(commandOptions)); + } + } else { + this.ui.writeLine(command.printBasicHelp(commandOptions)); + } + }); } });