zcatalyst-cli
Version:
Command Line Tool for CATALYST
29 lines (28 loc) • 1.28 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const ansi_colors_1 = require("ansi-colors");
const command_1 = __importDefault(require("../internal/command"));
const index_1 = require("../util_modules/logger/index");
exports.default = new command_1.default('help [command]')
.description('Display help information')
.action(function help(commandName) {
var _a, _b, _c;
if (commandName === undefined) {
(_a = this.client) === null || _a === void 0 ? void 0 : _a.cli.outputHelp();
(0, index_1.info)();
(0, index_1.info)(' To get help with a specific command, type ' +
(0, ansi_colors_1.bold)('catalyst help [command_name]'));
return;
}
const cmd = (_b = this.client) === null || _b === void 0 ? void 0 : _b.getCommand(commandName);
if (cmd === null || cmd === undefined) {
(0, index_1.warning)((0, ansi_colors_1.bold)(commandName) + ' is not a valid command. See below for valid commands');
(_c = this.client) === null || _c === void 0 ? void 0 : _c.cli.outputHelp();
}
else {
cmd.outputHelp();
}
});