@@ -32,11 +32,16 @@ program
3232 . option ( '-r, --rules [ruleFile]' , 'provide multiple rules files' , collect , [ ] )
3333 . option ( '-s, --skip [ruleName]' , 'provide multiple rules to skip' , collect , [ ] )
3434 . option ( '-j, --json-schema' , 'treat $ref like JSON Schema and convert to OpenAPI Schema Objects (default: false)' )
35- . option ( '-v, --verbose' , 'increase verbosity' , increaseVerbosity , 0 )
35+ . option ( '-v, --verbose' , 'increase verbosity' , increaseVerbosity , 1 )
3636 . action ( ( specFile , cmd ) => {
3737 lint . command ( specFile , cmd )
3838 . then ( ( ) => { process . exit ( 0 ) } )
39- . catch ( ( ) => { process . exit ( 1 ) } ) ;
39+ . catch ( ( err ) => {
40+ if ( err ) {
41+ console . error ( err . message ) ;
42+ }
43+ process . exit ( 1 ) ;
44+ } ) ;
4045 } ) ;
4146
4247program
@@ -45,11 +50,16 @@ program
4550 . option ( '-o, --output <file>' , 'file to output to' )
4651 . option ( '-q, --quiet' , 'reduce verbosity' )
4752 . option ( '-j, --json-schema' , 'treat $ref like JSON Schema and convert to OpenAPI Schema Objects (default: false)' )
48- . option ( '-v, --verbose' , 'increase verbosity' , increaseVerbosity , 0 )
49- . action ( ( file , cmd ) => {
50- resolve . command ( file , cmd )
53+ . option ( '-v, --verbose' , 'increase verbosity' , increaseVerbosity , 1 )
54+ . action ( ( specFile , cmd ) => {
55+ resolve . command ( specFile , cmd )
5156 . then ( ( ) => { process . exit ( 0 ) } )
52- . catch ( ( ) => { process . exit ( 1 ) } ) ;
57+ . catch ( ( err ) => {
58+ if ( err ) {
59+ console . error ( err . message ) ;
60+ }
61+ process . exit ( 1 ) ;
62+ } ) ;
5363 } ) ;
5464
5565program
@@ -58,9 +68,17 @@ program
5868 . option ( '-p, --port [value]' , 'port on which the server will listen (default: 5000)' )
5969 . option ( '-q, --quiet' , 'reduce verbosity' )
6070 . option ( '-j, --json-schema' , 'treat $ref like JSON Schema and convert to OpenAPI Schema Objects (default: false)' )
61- . option ( '-v, --verbose' , 'increase verbosity' , increaseVerbosity , 0 )
71+ . option ( '-v, --verbose' , 'increase verbosity' , increaseVerbosity , 1 )
6272 // TODO .option('-w, --watch', 'reloading browser on spec file changes')
63- . action ( serve . command ) ;
73+ . action ( ( specFile , cmd ) => {
74+ serve . command ( specFile , cmd )
75+ . catch ( ( err ) => {
76+ if ( err ) {
77+ console . error ( err . message ) ;
78+ }
79+ process . exit ( 1 ) ;
80+ } ) ;
81+ } ) ;
6482
6583program . parse ( process . argv ) ;
6684
0 commit comments