@sasjs/cli
Version:
Command line interface for SASjs
16 lines (15 loc) • 701 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.parse = void 0;
var getBaseCommand_1 = require("../../utils/getBaseCommand");
var commandFactory_1 = require("./commandFactory");
var parse = function (args) {
var _a;
var baseCommand = (0, getBaseCommand_1.getBaseCommand)(args);
if (!Array.from(commandFactory_1.commandFactory.keys()).includes(baseCommand.name)) {
(_a = process.logger) === null || _a === void 0 ? void 0 : _a.error('Invalid SASjs command! Run `sasjs help` for a full list of available commands.');
process.exit(1);
}
return commandFactory_1.commandFactory.get(baseCommand.name)(args);
};
exports.parse = parse;