aoc-copilot
Version:
Advent of Code automatic runner for examples and inputs
42 lines • 1.24 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.argsToOptions = argsToOptions;
const yargs_1 = __importDefault(require("yargs"));
const helpers_1 = require("yargs/helpers");
function argsToOptions(args) {
const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(args))
.option('force-submit', {
alias: 'f',
type: 'boolean'
})
.option('only-part', {
alias: 'o',
type: 'number'
})
.option('skip-tests', {
alias: 's',
type: 'boolean'
})
.option('tests-only', {
alias: 't',
type: 'boolean'
})
.argv;
const options = {};
for (let [arg, val] of Object.entries(argv)) {
if (arg === 'force-submit')
options.forceSubmit = val;
else if (arg === 'only-part')
options.onlyPart = val;
else if (arg === 'skip-tests')
options.skipTests = val;
else if (arg === 'tests-only')
options.testsOnly = val;
}
;
return options;
}
//# sourceMappingURL=options.js.map