@@ -15,16 +15,6 @@ var semver = require('semver'),
1515\\____/_/\\____/\\__,_/\\__,_/ /_____/_/ /_/ |___/\\___/
1616` ;
1717
18- try {
19- if ( semver . lt ( process . version . replace ( 'v' , '' ) , '4.0.0' ) ) {
20- console . log ( `${ pkgJson . name . green } , CLI version ${ pkgJson . version } ` ) ;
21- console . error ( 'ERROR: Cloud Drive requires Node.js 4.0.0 or newer.' . white . bgRed ) ;
22- console . error ( `\nVisit ${ 'http://nodejs.org/' . cyan } to download a newer version.\n` ) ;
23- process . exit ( 1 ) ;
24- }
25- } catch ( e ) {
26- }
27-
2818var config = {
2919 commands : {
3020 cat : {
@@ -368,19 +358,25 @@ var config = {
368358 } ,
369359 global : {
370360 options : {
361+ h : {
362+ group : 'Global Flags'
363+ } ,
371364 v : {
372- group : 'Global Flags: ' ,
365+ group : 'Global Flags' ,
373366 alias : 'verbose' ,
374367 demand : false ,
375368 desc : 'Output verbosity: 1 for normal (-v), 2 for more verbose (-vv), and 3 for debug (-vvv)' ,
376369 type : 'count'
377370 } ,
378371 q : {
379- group : 'Global Flags: ' ,
372+ group : 'Global Flags' ,
380373 alias : 'quiet' ,
381374 demand : false ,
382375 desc : 'Suppress all output' ,
383376 type : 'boolean'
377+ } ,
378+ V : {
379+ group : 'Global Flags'
384380 }
385381 }
386382 }
@@ -392,21 +388,16 @@ if (!appConfig.get('cli.colors')) {
392388}
393389
394390async . forEachOfSeries ( config . commands , ( command , name , callback ) => {
395- yargs . command ( name , command . desc , ( yargs , argv ) => {
396- argv = yargs . usage ( `\nUsage: ${ name } ${ command . usage } ` )
391+ yargs . command ( name , command . desc , yargs => {
392+ return yargs . usage ( `\nUsage: ${ name } ${ command . usage } ` )
397393 . options ( command . options )
398- . help ( 'help' )
399- . alias ( 'h' , 'help' )
400- . group ( 'h' , 'Global Flags:' )
401394 . options ( config . global . options )
402- . strict ( )
403395 . fail ( ( message ) => {
404396 yargs . showHelp ( ) ;
405397 Command . error ( message ) ;
406398 Command . shutdown ( 1 ) ;
407- } )
408- . argv ;
409-
399+ } ) ;
400+ } , argv => {
410401 Command . VERBOSE_LEVEL = argv . verbose ;
411402 if ( argv . quiet ) {
412403 Command . VERBOSE_LEVEL = - 1 ;
@@ -428,11 +419,9 @@ async.forEachOfSeries(config.commands, (command, name, callback) => {
428419 . version ( function ( ) {
429420 return `v${ pkgJson . version } ` ;
430421 } )
431- . alias ( 'V' , 'version' )
432- . group ( 'V' , 'Flags:' )
433422 . help ( 'h' )
434423 . alias ( 'h' , 'help' )
435- . group ( 'h ', 'Global Flags: ' )
424+ . alias ( 'V ', 'version ' )
436425 . options ( config . global . options )
437426 . epilog ( `Copyright ${ new Date ( ) . getFullYear ( ) } ` )
438427 . strict ( )
0 commit comments