1
1
#!/usr/bin/env node
2
2
const creatrDapp = require ( ".//lib/CreateDapp" ) ;
3
- const argv = require ( 'yargs' ) . command ( 'dapp' , 'create a file' , ( yargs ) => {
4
- return yargs
5
- . option ( 'name' , {
6
- alias : 'n' ,
7
- describe : 'clone a file'
8
- } )
9
- . option ( 'type' , {
10
- alias : 't' ,
11
- describe : 'f2e framework type vue or react' ,
12
- choices : [ 'vue' , 'react' ] ,
13
- default : 'vue'
14
- } )
15
- . demandOption ( [ 'name' ] , '請輸入創建文件名字' )
16
- . example (
17
- 'kaizen dapp -n <package name> -t <vue or react>' ,
18
- 'git clone 模板'
19
- )
20
- } ,
21
- ( argv ) => {
22
- const { name, type} = argv ;
23
- creatrDapp ( { name, type} ) ;
24
- }
25
- ) . argv ;
3
+ const argv = require ( 'yargs' )
4
+ . usage ( 'Kaizen v0.0.1 - a dapp framework for Blockchain\n\nUsage: $0 <command> [options]' )
5
+ . command ( 'dapp' , 'create a file' , ( yargs ) => {
6
+ return yargs
7
+ . option ( 'name' , {
8
+ alias : 'n' ,
9
+ describe : 'clone a file'
10
+ } )
11
+ . option ( 'type' , {
12
+ alias : 't' ,
13
+ describe : 'f2e framework type vue or react' ,
14
+ choices : [ 'vue' , 'react' ] ,
15
+ default : 'vue'
16
+ } )
17
+ . demandOption ( [ 'name' ] , '請輸入創建文件名字' )
18
+ . example (
19
+ 'kaizen dapp -n <package name> -t <vue or react>' ,
20
+ 'git clone 模板'
21
+ )
22
+ } ,
23
+ ( argv ) => {
24
+ const { name, type } = argv ;
25
+ creatrDapp ( { name, type } ) ;
26
+ }
27
+ )
28
+ . help ( 'h' )
29
+ . alias ( 'h' , 'help' )
30
+ . alias ( 'v' , 'version' )
31
+ . epilog ( 'copyright Portal Network 2018' )
32
+ . argv ;
0 commit comments