File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -102,8 +102,14 @@ function main() {
102102
103103 // Get any provided command-line options:
104104 flags = cli . flags ( ) ;
105+ if ( flags . help || flags . version ) {
106+ return ;
107+ }
105108
106109 // Extract the command:
110+ if ( args . length === 0 ) {
111+ return cli . help ( ) ;
112+ }
107113 if ( args [ 0 ] === 'help' ) {
108114 if ( args . length === 1 ) {
109115 return cli . help ( ) ;
@@ -125,7 +131,12 @@ function main() {
125131 keys = getKeys ( flags ) ;
126132 for ( i = 0 ; i < keys . length ; i ++ ) {
127133 key = keys [ i ] ;
128- if ( key === 'h' || key === 'help' || key === 'V' || key === 'version' ) { // eslint-disable-line max-len
134+ if (
135+ key === 'h' ||
136+ key === 'help' ||
137+ key === 'V' ||
138+ key === 'version'
139+ ) {
129140 continue ;
130141 }
131142 subargs . push ( '--' + keys [ i ] + '=' + flags [ keys [ i ] ] ) ;
You can’t perform that action at this time.
0 commit comments