cli-handler
v0.0.7
Published
A command line interface handler for the CLI
Downloads
17
Maintainers
Readme
CLI Handler
import { parse, Directive, Handler } from 'cli-handler';
const generateServiceHandler: Handler = (value, flags) => {
console.log({
value,
flags,
});
};
const DIRECTIVES: Directive[] = [
{
path: 'g|generate',
description: 'Generate a new project',
children: [
{
input: true,
path: 'c|component',
description: 'Template to use',
},
{
input: true,
path: 's|service',
description: 'Template to use',
flags: ['flat', 'tests'],
handler: generateServiceHandler,
},
],
},
];
parse(DIRECTIVES);