Skip to content

Commit 51659b9

Browse files
tsabirgalievhansl
authored andcommitted
fix(help): fix ng help <command> (angular#3442)
1 parent 0365118 commit 51659b9

File tree

1 file changed

+7
-1
lines changed
  • packages/angular-cli/commands

1 file changed

+7
-1
lines changed

packages/angular-cli/commands/help.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ const HelpCommand = Command.extend({
1818

1919
availableOptions: [],
2020

21+
anonymousOptions: ['command-name (Default: all)'],
22+
2123
run: function (commandOptions: any, rawArgs: any) {
2224
let commandFiles = fs.readdirSync(__dirname)
2325
// Remove files that are not JavaScript or Typescript
@@ -38,6 +40,10 @@ const HelpCommand = Command.extend({
3840
return acc;
3941
}, {});
4042

43+
if (rawArgs.indexOf('all') !== -1) {
44+
rawArgs = []; // just act as if command not specified
45+
}
46+
4147
commandFiles.forEach(cmd => {
4248
let Command = lookupCommand(commandMap, cmd);
4349

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

5157
if (rawArgs.length > 0) {
5258
if (cmd === rawArgs[0]) {
53-
this.ui.writeLine(command.printDetailedHelp(commandOptions));
59+
this.ui.writeLine(command.printBasicHelp(commandOptions));
5460
}
5561
} else {
5662
this.ui.writeLine(command.printBasicHelp(commandOptions));

0 commit comments

Comments
 (0)