File tree 3 files changed +12
-15
lines changed 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 ' ) ,
3
3
loadConfig = require ( '../lib/load_config.js' ) ;
4
- var yargs = require ( 'yargs' )
5
4
6
5
function parse ( args ) {
7
6
// reset() needs to be called at parse time because the yargs module uses an
@@ -98,11 +97,6 @@ module.exports = function (args) {
98
97
}
99
98
}
100
99
101
- if ( ! documentation . formats [ argv . f ] ) {
102
- yargs . showHelp ( ) ;
103
- throw new Error ( 'Formatter not found' ) ;
104
- }
105
-
106
100
if ( argv . f === 'html' && argv . o === 'stdout' ) {
107
101
yargs . showHelp ( ) ;
108
102
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');
13
13
*/
14
14
module . exports = function ( comments , opts , callback ) {
15
15
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
+ } ) ;
23
19
24
20
return callback ( null , JSON . stringify ( comments , null , 2 ) ) ;
25
21
} ;
Original file line number Diff line number Diff line change @@ -94,6 +94,13 @@ test('bad -f option', function (t) {
94
94
} ) ;
95
95
} , options ) ;
96
96
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
+
97
104
test ( 'html with no destination' , function ( t ) {
98
105
documentation ( [ '-f html fixture/internal.input.js' ] , function ( err ) {
99
106
t . ok ( err . toString ( )
You can’t perform that action at this time.
0 commit comments