Skip to content

Commit 227db1c

Browse files
chore: updated yargs Fixed #836
1 parent 10bbba5 commit 227db1c

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

bin/documentation.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var yargs = require('yargs');
66
var commands = require('../lib/commands');
77

88
var argv = yargs
9+
.strict()
910
.command(commands.serve)
1011
.command(commands.build)
1112
.command(commands.lint)
@@ -19,9 +20,8 @@ var argv = yargs
1920
return yargs.exit(1);
2021
}
2122
})
22-
.version(function() {
23-
return require('../package').version;
24-
})
23+
.example('documentation build foo.js -f md > API.md')
24+
.version()
2525
.usage(
2626
`Usage:
2727

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"vfile-sort": "^2.0.0",
5555
"vinyl": "^2.0.0",
5656
"vinyl-fs": "^2.3.1",
57-
"yargs": "^6.0.1"
57+
"yargs": "^9.0.1"
5858
},
5959
"devDependencies": {
6060
"are-we-flow-yet": "^1.0.0",
@@ -137,8 +137,7 @@
137137
},
138138
"greenkeeper": {
139139
"ignore": [
140-
"remote-origin-url",
141-
"yargs"
140+
"remote-origin-url"
142141
]
143142
}
144143
}

src/commands/build.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ module.exports.builder = _.assign(
2323
sharedOptions.sharedOutputOptions,
2424
sharedOptions.sharedInputOptions,
2525
{
26-
example: 'documentation build foo.js -f md > API.md',
2726
output: {
28-
describe: 'output location. omit for stdout, otherwise is a filename ' +
27+
describe:
28+
'output location. omit for stdout, otherwise is a filename ' +
2929
'for single-file outputs and a directory name for multi-file outputs like html',
3030
default: 'stdout',
3131
alias: 'o'

src/commands/shared_options.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
* Adds shared options to any command that runs documentation
55
*/
66
module.exports.sharedInputOptions = {
7-
strict: true,
87
shallow: {
98
describe:
109
'shallow mode turns off dependency resolution, ' +
11-
'only processing the specified files (or the main script specified in package.json)',
10+
'only processing the specified files (or the main script specified in package.json)',
1211
default: false,
1312
type: 'boolean'
1413
},
@@ -27,13 +26,13 @@ module.exports.sharedInputOptions = {
2726
external: {
2827
describe:
2928
'a string / glob match pattern that defines which external ' +
30-
'modules will be whitelisted and included in the generated documentation.',
29+
'modules will be whitelisted and included in the generated documentation.',
3130
default: null
3231
},
3332
'require-extension': {
3433
describe:
3534
"additional extensions to include in require() and import's search algorithm." +
36-
'For instance, adding .es5 would allow require("adder") to find "adder.es5"',
35+
'For instance, adding .es5 would allow require("adder") to find "adder.es5"',
3736
// Ensure that the value is an array
3837
coerce: (value: string | Array<string>) => [].concat(value),
3938
alias: 're'
@@ -53,8 +52,8 @@ module.exports.sharedInputOptions = {
5352
access: {
5453
describe:
5554
'Include only comments with a given access level, out of private, ' +
56-
'protected, public, undefined. By default, public, protected, and undefined access ' +
57-
'levels are included',
55+
'protected, public, undefined. By default, public, protected, and undefined access ' +
56+
'levels are included',
5857
choices: ['public', 'private', 'protected', 'undefined'],
5958
array: true,
6059
alias: 'a'
@@ -68,13 +67,13 @@ module.exports.sharedInputOptions = {
6867
type: 'string',
6968
describe:
7069
'Infer private access based on the name. This is a regular expression that ' +
71-
'is used to match the name'
70+
'is used to match the name'
7271
},
7372
'document-exported': {
7473
type: 'boolean',
7574
describe:
7675
'Generate documentation for all exported bindings and members ' +
77-
'even if there is no JSDoc for them',
76+
'even if there is no JSDoc for them',
7877
default: false
7978
},
8079
'sort-order': {

0 commit comments

Comments
 (0)