mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-16 18:43:42 +08:00
29 lines
896 B
TypeScript
29 lines
896 B
TypeScript
/**
|
|
* @license
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
import { terminal } from '@angular-devkit/core';
|
|
import { Command } from '../models/command';
|
|
import { Schema as HelpCommandSchema } from './help';
|
|
|
|
export class HelpCommand extends Command<HelpCommandSchema> {
|
|
async run() {
|
|
this.logger.info(`Available Commands:`);
|
|
|
|
for (const name of Object.keys(Command.commandMap)) {
|
|
const cmd = Command.commandMap[name];
|
|
|
|
if (cmd.hidden) {
|
|
continue;
|
|
}
|
|
|
|
const aliasInfo = cmd.aliases.length > 0 ? ` (${cmd.aliases.join(', ')})` : '';
|
|
this.logger.info(` ${terminal.cyan(cmd.name)}${aliasInfo} ${cmd.description}`);
|
|
}
|
|
this.logger.info(`\nFor more detailed help run "ng [command name] --help"`);
|
|
}
|
|
}
|