UNPKG

@mbc-cqrs-serverless/cli

Version:

a CLI to get started with MBC CQRS serverless framework

25 lines (24 loc) 1.21 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.generateCommand = generateCommand; const generate_action_1 = __importDefault(require("../actions/generate.action")); const schematic_colection_1 = require("../schematics/schematic.colection"); async function generateCommand(program) { program .command('generate <schematic> [name]') .alias('g') .description(buildDescription()) .option('-d, --dry-run', 'Report actions that would be taken without writing out results.') .option('--mode <mode>', 'Specify the mode of operation: sync or async (default: async)', 'async') .option('--schema', 'Enable schema generation (default: true)', true) .option('--no-schema', 'Disable schema generation (default: false)', false) .action(generate_action_1.default); } function buildDescription() { return ('Generate a MBC-cqrs-serverless element.\n' + ` Schematics available on the collection:\n` + (0, schematic_colection_1.buildSchematicsListAsTable)()); }