@@ -5,12 +5,26 @@ import { create } from 'create-kkt';
5
5
6
6
async function run ( ) : Promise < void > {
7
7
try {
8
- const argvs = minimist ( process . argv . slice ( 2 ) ) ;
8
+ const argvs = minimist ( process . argv . slice ( 2 ) , {
9
+ alias : {
10
+ output : 'o' ,
11
+ force : 'f' ,
12
+ path : 'p' ,
13
+ example : 'e' ,
14
+ } ,
15
+ default : {
16
+ path : 'http://jaywcjlove.github.io/tsbb/' ,
17
+ output : '.' ,
18
+ force : false ,
19
+ example : 'basic' ,
20
+ } ,
21
+ } ) ;
9
22
if ( argvs . h || argvs . help ) {
10
23
console . log ( '\n Usage: create-tsbb <app-name> [options] [--help|h]' ) ;
11
24
console . log ( '\n Options:' ) ;
12
25
console . log ( ' --version, -v' , 'Show version number' ) ;
13
26
console . log ( ' --help, -h' , 'Displays help information.' ) ;
27
+ console . log ( ' --output, -o' , 'Output directory.' ) ;
14
28
console . log (
15
29
' --example, -e' ,
16
30
'Example from: \x1b[34mhttp://jaywcjlove.github.io/tsbb/ \x1b[0m , default: "basic"' ,
@@ -31,9 +45,7 @@ async function run(): Promise<void> {
31
45
return ;
32
46
}
33
47
argvs . appName = argvs . _ [ 0 ] ;
34
- argvs . path = argvs . p = argvs . path || argvs . p || 'http://jaywcjlove.github.io/tsbb/' ;
35
- argvs . force = argvs . f = argvs . force || argvs . f || false ;
36
- argvs . example = argvs . e = ( argvs . example || argvs . e || 'basic' ) . toLocaleLowerCase ( ) ;
48
+ argvs . example = argvs . e = String ( argvs . example ) . toLocaleLowerCase ( ) ;
37
49
create ( argvs , exampleHelp ) ;
38
50
} catch ( error ) {
39
51
console . log ( `\x1b[31m${ error . message } \x1b[0m` ) ;
0 commit comments