UNPKG

@hi18n/cli

Version:

Message internationalization meets immutability and type-safety - command line tool

39 lines (31 loc) 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.hi18n = hi18n; var _commander = require("commander"); var _export = require("./export"); var _sync = require("./sync"); async function hi18n(argv, cwd = process.cwd(), output, overrideExit) { const program = new _commander.Command(); program.name("hi18n").description("CLI for managing translations with hi18n"); if (output) program.configureOutput(output); if (overrideExit) program.exitOverride(); program.command("sync").description("Synchronize translation ids").argument("[files...]").option("--exclude <files...>").option("-c, --check", "report errors if one or more files would be changed").action(syncCommand); program.command("export").description("export data").action(exportCommand); async function syncCommand(files, options) { await (0, _sync.sync)({ cwd, include: files, exclude: options.exclude, checkOnly: options.check }); } async function exportCommand() { await (0, _export.export_)({ cwd }); } await program.parseAsync(argv); } //# sourceMappingURL=command.js.map