@argdown/cli
Version:
A command line interface for exporting Argdown files to html, dot or json.
33 lines • 1.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.handler = exports.desc = exports.command = void 0;
const node_1 = require("@argdown/node");
const runArgdown_1 = require("./runArgdown");
exports.command = "* [inputGlob]";
exports.desc = "load config file and run parser";
const handler = async (args) => {
let config = await node_1.argdown.loadConfig(args.config);
if (args.inputGlob) {
config.inputPath = args.inputGlob;
}
config.logParserErrors = args.logParserErrors || config.logParserErrors;
if (!config.process) {
config.process = ["load-file", "parse-input"];
if (config.logParserErrors) {
config.process.push("log-parser-errors");
}
}
config.logLevel = args.verbose ? "verbose" : config.logLevel;
config.logLevel = args.silent ? "silent" : config.logLevel;
config.watch = args.watch || config.watch;
config.throwExceptions = args.throwExceptions || config.throwExceptions;
if (config.throwExceptions) {
if (!config.parser) {
config.parser = {};
}
config.parser.throwExceptions = config.throwExceptions;
}
await (0, runArgdown_1.runArgdown)(node_1.argdown, config, true, "Further processing of file stopped", "checked");
};
exports.handler = handler;
//# sourceMappingURL=DefaultCommand.js.map