rgen-cli
Version:
A developer CLI for initializing React projects, managing utilities, and scaffolding components, hooks, pages, layouts, routes, and contexts quickly.
17 lines (16 loc) • 597 B
JavaScript
import { Args, Command, Flags } from '@oclif/core';
import Form from '../../libs/build-form.js';
export default class MakeForm extends Command {
static args = {
name: Args.string({ description: 'Name of the form', required: true }),
};
static description = 'Generate a React form';
static flags = {
page: Flags.string({ char: 'p', description: 'Name of the page to attach the form to' }),
};
async run() {
const { args, flags } = await this.parse(MakeForm);
const form = new Form(this, args.name, flags);
await form.setup();
}
}