-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
29 lines (23 loc) · 1.08 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env node
'use strict';
const program = require('commander');
const commands = require('./libs/commands');
program
.command('generate <type> [component-name]')
.alias('g')
.description('Generate a React component - defaults to class-based component')
.option('-f, --functional', 'Create functional (not class) component')
.option('-r, --redux', 'Create component (class only) with Redux code')
.option('-c, --components <components>', 'Add imports for components as comma separated list, eg -c List,ListItem,ListButton')
.option('--content <content>', 'Populate with content')
.option('--imports <imports>', 'Add import statements')
.action(commands.generate);
program.command('create <project-name>')
.alias('new')
.description('Make a new project in the <project-name> directory')
.option('-r,--redux', 'Include redux boilerplate and structure')
.option('--no-git', 'Do not include git files and init process')
.action(commands.create);
program.command('destroy <file>')
.action(commands.destroy);
program.parse(process.argv);