@ideascol/cli-maker
Version:
A simple library to help create CLIs
28 lines (27 loc) • 765 B
JavaScript
;
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: '2.2.2',
introAnimation: {
enabled: true,
title: 'CLI Maker',
subtitle: 'A simple CLI builder',
introMode: 'always',
preset: 'hacker'
}
});
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);