File tree Expand file tree Collapse file tree 3 files changed +12
-15
lines changed Expand file tree Collapse file tree 3 files changed +12
-15
lines changed Original file line number Diff line number Diff line change 1- var documentation = require ( '../ ' ) ,
2- path = require ( 'path ' ) ,
1+ var path = require ( 'path ' ) ,
2+ yargs = require ( 'yargs ' ) ,
33 loadConfig = require ( '../lib/load_config.js' ) ;
4- var yargs = require ( 'yargs' )
54
65function parse ( args ) {
76 // reset() needs to be called at parse time because the yargs module uses an
@@ -98,11 +97,6 @@ module.exports = function (args) {
9897 }
9998 }
10099
101- if ( ! documentation . formats [ argv . f ] ) {
102- yargs . showHelp ( ) ;
103- throw new Error ( 'Formatter not found' ) ;
104- }
105-
106100 if ( argv . f === 'html' && argv . o === 'stdout' ) {
107101 yargs . showHelp ( ) ;
108102 throw new Error ( 'The HTML output mode requires a destination directory set with -o' ) ;
Original file line number Diff line number Diff line change @@ -13,13 +13,9 @@ var walk = require('../walk');
1313 */
1414module . exports = function ( comments , opts , callback ) {
1515
16- opts = opts || { } ;
17-
18- if ( ! opts . preserveErrors ) {
19- walk ( comments , function ( comment ) {
20- delete comment . errors ;
21- } ) ;
22- }
16+ walk ( comments , function ( comment ) {
17+ delete comment . errors ;
18+ } ) ;
2319
2420 return callback ( null , JSON . stringify ( comments , null , 2 ) ) ;
2521} ;
Original file line number Diff line number Diff line change @@ -94,6 +94,13 @@ test('bad -f option', function (t) {
9494 } ) ;
9595} , options ) ;
9696
97+ test ( '--version' , function ( t ) {
98+ documentation ( [ '--version' ] , { } , function ( err , output ) {
99+ t . ok ( output , 'outputs version' ) ;
100+ t . end ( ) ;
101+ } , false ) ;
102+ } , options ) ;
103+
97104test ( 'html with no destination' , function ( t ) {
98105 documentation ( [ '-f html fixture/internal.input.js' ] , function ( err ) {
99106 t . ok ( err . toString ( )
You can’t perform that action at this time.
0 commit comments