UNPKG

quicksilver-cli

Version:
36 lines (35 loc) 1.41 kB
"use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", { value: true }); const command_1 = require("./command"); const all_comands_1 = require("./all-comands"); const HelpUtil = __importStar(require("../util/help")); const colors = require("colors"); class HelpCommand extends command_1.Command { constructor(workspace, params) { super(workspace, params); this.supportCache = false; } async run() { const commandsDetail = all_comands_1.commands .map(command => ` ${colors.cyan(all_comands_1.getName(command))} ${all_comands_1.getAliasReduce(command)} ${all_comands_1.getDescription(command)}`); const messages = [ `Available Commands:`, ...commandsDetail, ``, `For more detailed help run "${this.topCommand} [command name] --help"` ]; HelpUtil.print(...messages); } } HelpCommand.NAME = "help"; HelpCommand.ALIAS = ["h", "?"]; HelpCommand.FIELDS = []; HelpCommand.DESCRIPTION = "List available commands and their descriptions."; exports.HelpCommand = HelpCommand;