UNPKG

@ideascol/cli-maker

Version:

A simple library to help create CLIs

21 lines (20 loc) 590 B
#!/usr/bin/env node "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const index_1 = require("../index"); const commands_1 = require("./commands"); const cli = new index_1.CLI("cli", "A simple CLI builder", { interactive: true, version: '1.0.2', }); const versionCommand = { name: 'version', description: 'Show CLI version', params: [], action: () => { console.log(`\n${cli.getName()} version: ${cli.getOptions()?.version}\n`); } }; cli.command(commands_1.createCommand); cli.command(versionCommand); cli.parse(process.argv);