zcatalyst-cli
Version:
Command Line Tool for CATALYST
28 lines (27 loc) • 1.21 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getUnknownOpts = exports.getGlobalOptionValue = exports.setGlobalOption = exports.getOptionValue = exports.getCurrentCommand = void 0;
const runtime_store_1 = __importDefault(require("../runtime-store"));
function getCurrentCommand(fallback) {
return runtime_store_1.default.get('opts._name', fallback);
}
exports.getCurrentCommand = getCurrentCommand;
function getOptionValue(key, fallback) {
return runtime_store_1.default.get('opts.' + key, fallback);
}
exports.getOptionValue = getOptionValue;
function setGlobalOption(key, value) {
runtime_store_1.default.set('opts.globalOpts.' + key, value);
}
exports.setGlobalOption = setGlobalOption;
function getGlobalOptionValue(key, fallback) {
return runtime_store_1.default.get('opts.globalOpts.' + key, fallback);
}
exports.getGlobalOptionValue = getGlobalOptionValue;
function getUnknownOpts(fallback) {
return runtime_store_1.default.get('opts.unknownOpts', fallback);
}
exports.getUnknownOpts = getUnknownOpts;