1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const command_1 = require("../models/command");
|
4 | const core_1 = require("@angular-devkit/core");
|
5 | class 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 | }
|
35 | exports.default = HelpCommand;
|
36 |
|
\ | No newline at end of file |