help-impl.js 968 B

12345678910111213141516171819202122232425
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. /**
  4. * @license
  5. * Copyright Google Inc. All Rights Reserved.
  6. *
  7. * Use of this source code is governed by an MIT-style license that can be
  8. * found in the LICENSE file at https://angular.io/license
  9. */
  10. const command_1 = require("../models/command");
  11. const color_1 = require("../utilities/color");
  12. class HelpCommand extends command_1.Command {
  13. async run() {
  14. this.logger.info(`Available Commands:`);
  15. for (const cmd of Object.values(await command_1.Command.commandMap())) {
  16. if (cmd.hidden) {
  17. continue;
  18. }
  19. const aliasInfo = cmd.aliases.length > 0 ? ` (${cmd.aliases.join(', ')})` : '';
  20. this.logger.info(` ${color_1.colors.cyan(cmd.name)}${aliasInfo} ${cmd.description}`);
  21. }
  22. this.logger.info(`\nFor more detailed help run "ng [command name] --help"`);
  23. }
  24. }
  25. exports.HelpCommand = HelpCommand;