UNPKG

@vivliostyle/cli

Version:

Save the pdf file via headless browser and Vivliostyle.

45 lines (43 loc) 1.36 kB
import { create } from "../chunk-PYPAYBFL.js"; import { createParserProgram, gracefulError } from "../chunk-DBK27BAR.js"; import "../chunk-7GIJVX4M.js"; import { versionForDisplay } from "../chunk-OAFXM4ES.js"; import "../chunk-I7BWSAN6.js"; // src/commands/init.parser.ts import { Command, Option } from "commander"; function setupInitParserProgram() { const program = new Command(); program.name("vivliostyle init").description("create vivliostyle config file").option("--title <title>", "title").option("--author <author>", "author").option("-l, --language <language>", "language").option("-s, --size <size>", "paper size").option("-T, --theme <theme>", "theme").addOption( new Option( "--log-level <level>", "specify a log level of console outputs" ).choices(["silent", "info", "verbose", "debug"]).default("info") ).version(versionForDisplay, "-v, --version"); return program; } var parseInitCommand = createParserProgram({ setupProgram: setupInitParserProgram, parseArgs: (options) => ({ ...options, projectPath: ".", createConfigFileOnly: true, template: void 0 }) }); // src/commands/init.ts try { const inlineConfig = parseInitCommand(process.argv); await create(inlineConfig); } catch (err) { if (err instanceof Error) { gracefulError(err); } } //# sourceMappingURL=init.js.map