nativescript
Version:
Command-line interface for building NativeScript projects
39 lines • 1.34 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.HelpCommand = void 0;
const _ = require("lodash");
const yok_1 = require("../yok");
class HelpCommand {
constructor($injector, $helpService, $options) {
this.$injector = $injector;
this.$helpService = $helpService;
this.$options = $options;
this.enableHooks = false;
this.allowedParameters = [];
}
async canExecute(args) {
return true;
}
async execute(args) {
let commandName = (args[0] || "").toLowerCase();
let commandArguments = _.tail(args);
const hierarchicalCommand = this.$injector.buildHierarchicalCommand(args[0], commandArguments);
if (hierarchicalCommand) {
commandName = hierarchicalCommand.commandName;
commandArguments = hierarchicalCommand.remainingArguments;
}
const commandData = {
commandName,
commandArguments,
};
if (this.$options.help) {
await this.$helpService.showCommandLineHelp(commandData);
}
else {
await this.$helpService.openHelpForCommandInBrowser(commandData);
}
}
}
exports.HelpCommand = HelpCommand;
yok_1.injector.registerCommand(["help", "/?"], HelpCommand);
//# sourceMappingURL=help.js.map
;