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 11const yargs = require ( 'yargs' ) ;
2- const { handler , describe , cliInfo } = require ( './command' ) ;
2+ const DefaultCommand = require ( './command' ) ;
33
44function cli ( cwd ) {
55 yargs . help ( ) ;
@@ -9,19 +9,8 @@ function cli(cwd) {
99
1010 yargs . default ( 'path' , cwd ) ;
1111
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 ) ;
2514
2615 return yargs ;
2716}
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' ;
25
36const cliInfo = {
47 options : {
@@ -27,8 +30,18 @@ const cliInfo = {
2730 }
2831} ;
2932
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+
3041module . 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
3447} ;
You can’t perform that action at this time.
0 commit comments