UNPKG

1.25 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const command_1 = require("../models/command");
4const core_1 = require("@angular-devkit/core");
5class HelpCommand extends command_1.Command {
6 constructor() {
7 super(...arguments);
8 this.name = 'help';
9 this.description = 'Help.';
10 this.arguments = [];
11 this.options = [];
12 }
13 run(options) {
14 const commands = Object.keys(options.commandMap)
15 .map(key => {
16 const Cmd = options.commandMap[key];
17 const command = new Cmd(null, null);
18 return command;
19 })
20 .filter(cmd => !cmd.hidden && !cmd.unknown)
21 .map(cmd => ({
22 name: cmd.name,
23 description: cmd.description
24 }));
25 this.logger.info(`Available Commands:`);
26 commands.forEach(cmd => {
27 this.logger.info(` ${core_1.terminal.cyan(cmd.name)} ${cmd.description}`);
28 });
29 this.logger.info(`\nFor more detailed help run "ng [command name] --help"`);
30 }
31 printHelp(options) {
32 return this.run(options);
33 }
34}
35exports.default = HelpCommand;
36//# sourceMappingURL=/Users/hansl/Sources/hansl/angular-cli/commands/help.js.map
\No newline at end of file