@@ -4,42 +4,50 @@ var fs = require('fs');
4
4
var remark = require ( 'remark' ) ;
5
5
var path = require ( 'path' ) ;
6
6
var documentation = require ( '../' ) ;
7
+ var sharedOptions = require ( './shared_options' ) ;
7
8
var inject = require ( 'mdast-util-inject' ) ;
8
9
var chalk = require ( 'chalk' ) ;
9
10
var disparity = require ( 'disparity' ) ;
11
+ var _ = require ( 'lodash' ) ;
10
12
11
13
module . exports . command = 'readme [input..]' ;
12
14
module . exports . description = 'inject documentation into your README.md' ;
15
+
13
16
/**
14
17
* Add yargs parsing for the readme command
15
18
* @param {Object } yargs module instance
16
19
* @returns {Object } yargs with options
17
20
* @private
18
21
*/
19
- module . exports . builder = {
20
- 'readme-file' : {
21
- describe : 'The markdown file into which to inject documentation' ,
22
- default : 'README.md'
23
- } ,
24
- section : {
25
- alias : 's' ,
26
- describe :
27
- 'The section heading after which to inject generated documentation' ,
28
- required : true
29
- } ,
30
- 'diff-only' : {
31
- alias : 'd' ,
32
- describe :
33
- 'Instead of updating the given README with the generated documentation,' +
34
- ' just check if its contents match, exiting nonzero if not.' ,
35
- default : false
36
- } ,
37
- quiet : {
38
- alias : 'q' ,
39
- describe : 'Quiet mode: do not print messages or README diff to stdout.' ,
40
- default : false
22
+ module . exports . builder = _ . assign (
23
+ { } ,
24
+ sharedOptions . sharedOutputOptions ,
25
+ sharedOptions . sharedInputOptions ,
26
+ {
27
+ 'readme-file' : {
28
+ describe : 'The markdown file into which to inject documentation' ,
29
+ default : 'README.md'
30
+ } ,
31
+ section : {
32
+ alias : 's' ,
33
+ describe :
34
+ 'The section heading after which to inject generated documentation' ,
35
+ required : true
36
+ } ,
37
+ 'diff-only' : {
38
+ alias : 'd' ,
39
+ describe :
40
+ 'Instead of updating the given README with the generated documentation,' +
41
+ ' just check if its contents match, exiting nonzero if not.' ,
42
+ default : false
43
+ } ,
44
+ quiet : {
45
+ alias : 'q' ,
46
+ describe : 'Quiet mode: do not print messages or README diff to stdout.' ,
47
+ default : false
48
+ }
41
49
}
42
- } ;
50
+ ) ;
43
51
44
52
/**
45
53
* Insert API documentation into a Markdown readme
0 commit comments