UNPKG

zcatalyst-cli

Version:

Command Line Tool for CATALYST

28 lines (27 loc) 1.25 kB
'use strict'; 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('context.opts._name', fallback); } exports.getCurrentCommand = getCurrentCommand; function getOptionValue(key, fallback) { return runtime_store_1.default.get('context.opts.' + key, fallback); } exports.getOptionValue = getOptionValue; function setGlobalOption(key, value) { runtime_store_1.default.set('context.opts.globalOpts.' + key, value); } exports.setGlobalOption = setGlobalOption; function getGlobalOptionValue(key, fallback) { return runtime_store_1.default.get('context.opts.globalOpts.' + key, fallback); } exports.getGlobalOptionValue = getGlobalOptionValue; function getUnknownOpts(fallback) { return runtime_store_1.default.get('context.opts.unknownOpts', fallback); } exports.getUnknownOpts = getUnknownOpts;