UNPKG

meblog

Version:

A simple blog engine for personal blogging

34 lines (33 loc) 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const yargs_1 = tslib_1.__importDefault(require("yargs/yargs")); const helpers_1 = require("yargs/helpers"); const commands = tslib_1.__importStar(require("./commands")); const log_1 = require("./log"); const cli = () => { log_1.initLogger(); yargs_1.default(helpers_1.hideBin(process.argv)) .scriptName('meblog') .command(commands.init) .command(commands.sample) .command(commands.draft) .command(commands.serve) .command(commands.build) .showHelpOnFail(true) .help('help', 'Show help instructions') .alias('h', 'help') .alias('v', 'version') .option('config', { alias: 'c', type: 'string', description: 'Config file path', }) .epilog(`More information at: https://github.com/sinzii/meblog`) .strictCommands() .demandCommand(1).argv; }; exports.default = cli; if (require.main === module) { cli(); }