This repository was archived by the owner on Feb 3, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-18
lines changed Expand file tree Collapse file tree 2 files changed +20
-18
lines changed Original file line number Diff line number Diff line change 1
1
const yargs = require ( 'yargs' ) ;
2
- const { handler , describe , cliInfo } = require ( './command' ) ;
2
+ const DefaultCommand = require ( './command' ) ;
3
3
4
4
function cli ( cwd ) {
5
5
yargs . help ( ) ;
@@ -9,19 +9,8 @@ function cli(cwd) {
9
9
10
10
yargs . default ( 'path' , cwd ) ;
11
11
12
- yargs . usage ( describe ) ;
13
- yargs . command (
14
- '$0 <name>' ,
15
- describe ,
16
- command => {
17
- command . positional ( 'name' , {
18
- describe : 'Name of your project.' ,
19
- type : 'string'
20
- } ) ;
21
- command . options ( cliInfo . options ) ;
22
- } ,
23
- argv => handler ( argv )
24
- ) ;
12
+ yargs . usage ( DefaultCommand . describe ) ;
13
+ yargs . command ( DefaultCommand ) ;
25
14
26
15
return yargs ;
27
16
}
Original file line number Diff line number Diff line change 1
- const createTwilioFunction = require ( './create-twilio-function' ) ;
1
+ const handler = require ( './create-twilio-function' ) ;
2
+
3
+ const command = '$0 <name>' ;
4
+ const describe = 'Creates a new Twilio Function project' ;
2
5
3
6
const cliInfo = {
4
7
options : {
@@ -27,8 +30,18 @@ const cliInfo = {
27
30
}
28
31
} ;
29
32
33
+ const builder = command => {
34
+ command . positional ( 'name' , {
35
+ describe : 'Name of your project.' ,
36
+ type : 'string'
37
+ } ) ;
38
+ command . options ( cliInfo . options ) ;
39
+ } ;
40
+
30
41
module . exports = {
31
- describe : 'Creates a new Twilio Function project' ,
32
- handler : createTwilioFunction ,
33
- cliInfo : cliInfo
42
+ command,
43
+ describe,
44
+ handler,
45
+ cliInfo,
46
+ builder
34
47
} ;
You can’t perform that action at this time.
0 commit comments