Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(help): show correct listing of blueprints for generate help #2580

Merged
merged 3 commits into from
Oct 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/angular-cli/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down
11 changes: 9 additions & 2 deletions packages/angular-cli/commands/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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$/))
Expand Down Expand Up @@ -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));
}

});
}
});
Expand Down