@@ -6,100 +6,115 @@ const yargs = require('yargs')
66const chalk = require ( 'chalk' )
77
88const argv = yargs
9- . usage ( 'Usage: $0 <command> <client> <instance> --switches' )
9+ . usage ( 'Usage: sfcc <command> <client> <instance> --switches' )
1010 . command ( 'setup' , 'Setup SFCC Development' , {
1111 client : {
1212 alias : 'c' ,
13- describe : 'Client Name'
13+ describe : 'Client Name' ,
14+ type : 'string'
1415 } ,
1516 hostname : {
1617 alias : 'h' ,
17- describe : 'Hostname for Instance'
18+ describe : 'Hostname for Instance' ,
19+ type : 'string'
1820 } ,
1921 version : {
2022 alias : 'v' ,
21- describe : 'Code Version'
23+ describe : 'Code Version' ,
24+ type : 'string'
2225 } ,
2326 directory : {
2427 alias : 'd' ,
25- describe : 'Absolute path to Repository'
28+ describe : 'Absolute path to Repository' ,
29+ type : 'string'
2630 } ,
2731 username : {
2832 alias : 'u' ,
29- describe : 'Your Business Manager Username'
33+ describe : 'Your Business Manager Username' ,
34+ type : 'string'
3035 } ,
3136 password : {
3237 alias : 'p' ,
33- describe : 'Your Business Manager Password'
38+ describe : 'Your Business Manager Password' ,
39+ type : 'string'
3440 } ,
3541 alias : {
3642 alias : 'a' ,
3743 describe : 'Instance Alias' ,
38- default : 'sandbox'
44+ default : 'sandbox' ,
45+ type : 'string'
3946 }
4047 } )
4148 . command ( 'list' , 'List Configured SFCC Clients' )
4249 . command ( 'delete <client> [instance]' , 'Delete Config for Client' )
4350 . command ( 'watch [client] [instance]' , 'Watch for Changes and Push Updates' , {
4451 log : {
4552 describe : 'Pipe Output to Log File ~/.sffc-cli.log' ,
53+ type : 'boolean' ,
4654 default : false
4755 } ,
4856 'errors-only' : {
4957 describe : 'Only Show Notification for Errors' ,
58+ type : 'boolean' ,
5059 default : false
5160 }
5261 } )
5362 . command ( 'log [client] [instance]' , 'Stream log files from an instance' , {
54- interval : {
55- describe : 'Polling interval (seconds)' ,
63+ polling : {
64+ alias : 'p' ,
65+ describe : 'Polling Interval (seconds)' ,
66+ type : 'number' ,
5667 default : 2
5768 } ,
5869 lines : {
59- describe : 'Number of lines to display' ,
70+ alias : 'l' ,
71+ describe : 'Number of Lines to Display' ,
72+ type : 'number' ,
6073 default : 100
6174 } ,
6275 include : {
63- describe : 'Log levels to include' ,
76+ alias : 'i' ,
77+ describe : 'Log Types to Include' ,
6478 type : 'array' ,
6579 default : [ ]
6680 } ,
6781 exclude : {
68- describe : 'Log levels to exclude' ,
82+ alias : 'e' ,
83+ describe : 'Log Types to Exclude' ,
6984 type : 'array' ,
7085 default : [ ]
7186 } ,
72- list : {
73- describe : 'Output a list of available log levels' ,
74- default : false
75- } ,
76- dates : {
77- describe : 'Output a list of available log dates' ,
78- default : false
79- } ,
8087 filter : {
81- describe : 'Filter log messages by regexp' ,
88+ alias : 'f' ,
89+ describe : 'Filter Log Messages by RegExp' ,
90+ type : 'string' ,
8291 default : null
8392 } ,
84- length : {
85- describe : 'Length to truncate a log message' ,
93+ truncate : {
94+ alias : 't' ,
95+ describe : 'Length to Truncate Messages' ,
96+ type : 'number' ,
8697 default : null
8798 } ,
88- search : {
89- describe : 'Search all log files' ,
99+ list : {
100+ describe : 'Output List of Log Types' ,
101+ type : 'boolean' ,
90102 default : false
91103 } ,
92- 'no-timestamp' : {
93- describe : "Don't convert timestamps to local time" ,
104+ search : {
105+ describe : 'Search Logs with no Live Updates' ,
106+ type : 'boolean' ,
94107 default : false
95108 } ,
96109 latest : {
97110 describe : 'Show Latest Logs Only' ,
98- boolean : false
111+ type : 'boolean' ,
112+ default : false
99113 }
100114 } )
101- . example ( '$0 delete my-client sandbox' , 'Delete my-client sandbox config' )
102- . example ( '$0 watch my-client sandbox' , 'Watch for my-client sandbox changes' )
115+ . example ( 'sfcc delete my-client sandbox' , 'Delete my-client sandbox config' )
116+ . example ( 'sfcc watch my-client sandbox' , 'Watch for my-client sandbox changes' )
117+ . example ( 'sfcc log -i customerror --latest' , 'Watch Latest Custom Error Logs' )
103118 . demand ( 1 )
104119 . help ( )
105120 . version ( ) . argv
0 commit comments