Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d84d835

Browse files
committedDec 8, 2017
Add shared_options to readme command.
This makes --shallow and --format work again.
1 parent 67978eb commit d84d835

File tree

1 file changed

+31
-23
lines changed

1 file changed

+31
-23
lines changed
 

‎src/commands/readme.js

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,50 @@ var fs = require('fs');
44
var remark = require('remark');
55
var path = require('path');
66
var documentation = require('../');
7+
var sharedOptions = require('./shared_options');
78
var inject = require('mdast-util-inject');
89
var chalk = require('chalk');
910
var disparity = require('disparity');
11+
var _ = require('lodash');
1012

1113
module.exports.command = 'readme [input..]';
1214
module.exports.description = 'inject documentation into your README.md';
15+
1316
/**
1417
* Add yargs parsing for the readme command
1518
* @param {Object} yargs module instance
1619
* @returns {Object} yargs with options
1720
* @private
1821
*/
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+
}
4149
}
42-
};
50+
);
4351

4452
/**
4553
* Insert API documentation into a Markdown readme

0 commit comments

Comments
 (0)
Please sign in to comment.