Skip to content

Commit

Permalink
fix(help): fix ng help <command> (angular#3442)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsabirgaliev authored and MRHarrison committed Feb 9, 2017
1 parent cbcfa45 commit 1f8c6da
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/angular-cli/commands/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const HelpCommand = Command.extend({

availableOptions: [],

anonymousOptions: ['command-name (Default: all)'],

run: function (commandOptions: any, rawArgs: any) {
let commandFiles = fs.readdirSync(__dirname)
// Remove files that are not JavaScript or Typescript
Expand All @@ -38,6 +40,10 @@ const HelpCommand = Command.extend({
return acc;
}, {});

if (rawArgs.indexOf('all') !== -1) {
rawArgs = []; // just act as if command not specified
}

commandFiles.forEach(cmd => {
let Command = lookupCommand(commandMap, cmd);

Expand All @@ -50,7 +56,7 @@ const HelpCommand = Command.extend({

if (rawArgs.length > 0) {
if (cmd === rawArgs[0]) {
this.ui.writeLine(command.printDetailedHelp(commandOptions));
this.ui.writeLine(command.printBasicHelp(commandOptions));
}
} else {
this.ui.writeLine(command.printBasicHelp(commandOptions));
Expand Down

0 comments on commit 1f8c6da

Please sign in to comment.