From 227db1c9ee493b8fac033714e230ed1c3defe78b Mon Sep 17 00:00:00 2001 From: Anton Shchekota Date: Fri, 29 Sep 2017 18:50:38 +0300 Subject: [PATCH] chore: updated yargs Fixed #836 --- bin/documentation.js | 6 +++--- package.json | 5 ++--- src/commands/build.js | 4 ++-- src/commands/shared_options.js | 15 +++++++-------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/bin/documentation.js b/bin/documentation.js index 7c8d41ce4..17bd0b14d 100755 --- a/bin/documentation.js +++ b/bin/documentation.js @@ -6,6 +6,7 @@ var yargs = require('yargs'); var commands = require('../lib/commands'); var argv = yargs + .strict() .command(commands.serve) .command(commands.build) .command(commands.lint) @@ -19,9 +20,8 @@ var argv = yargs return yargs.exit(1); } }) - .version(function() { - return require('../package').version; - }) + .example('documentation build foo.js -f md > API.md') + .version() .usage( `Usage: diff --git a/package.json b/package.json index b0ca0275b..5f03ffdac 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "vfile-sort": "^2.0.0", "vinyl": "^2.0.0", "vinyl-fs": "^2.3.1", - "yargs": "^6.0.1" + "yargs": "^9.0.1" }, "devDependencies": { "are-we-flow-yet": "^1.0.0", @@ -137,8 +137,7 @@ }, "greenkeeper": { "ignore": [ - "remote-origin-url", - "yargs" + "remote-origin-url" ] } } \ No newline at end of file diff --git a/src/commands/build.js b/src/commands/build.js index 17b89611b..73bc183ed 100644 --- a/src/commands/build.js +++ b/src/commands/build.js @@ -23,9 +23,9 @@ module.exports.builder = _.assign( sharedOptions.sharedOutputOptions, sharedOptions.sharedInputOptions, { - example: 'documentation build foo.js -f md > API.md', output: { - describe: 'output location. omit for stdout, otherwise is a filename ' + + describe: + 'output location. omit for stdout, otherwise is a filename ' + 'for single-file outputs and a directory name for multi-file outputs like html', default: 'stdout', alias: 'o' diff --git a/src/commands/shared_options.js b/src/commands/shared_options.js index 73b1445b8..39cc9039d 100644 --- a/src/commands/shared_options.js +++ b/src/commands/shared_options.js @@ -4,11 +4,10 @@ * Adds shared options to any command that runs documentation */ module.exports.sharedInputOptions = { - strict: true, shallow: { describe: 'shallow mode turns off dependency resolution, ' + - 'only processing the specified files (or the main script specified in package.json)', + 'only processing the specified files (or the main script specified in package.json)', default: false, type: 'boolean' }, @@ -27,13 +26,13 @@ module.exports.sharedInputOptions = { external: { describe: 'a string / glob match pattern that defines which external ' + - 'modules will be whitelisted and included in the generated documentation.', + 'modules will be whitelisted and included in the generated documentation.', default: null }, 'require-extension': { describe: "additional extensions to include in require() and import's search algorithm." + - 'For instance, adding .es5 would allow require("adder") to find "adder.es5"', + 'For instance, adding .es5 would allow require("adder") to find "adder.es5"', // Ensure that the value is an array coerce: (value: string | Array) => [].concat(value), alias: 're' @@ -53,8 +52,8 @@ module.exports.sharedInputOptions = { access: { describe: 'Include only comments with a given access level, out of private, ' + - 'protected, public, undefined. By default, public, protected, and undefined access ' + - 'levels are included', + 'protected, public, undefined. By default, public, protected, and undefined access ' + + 'levels are included', choices: ['public', 'private', 'protected', 'undefined'], array: true, alias: 'a' @@ -68,13 +67,13 @@ module.exports.sharedInputOptions = { type: 'string', describe: 'Infer private access based on the name. This is a regular expression that ' + - 'is used to match the name' + 'is used to match the name' }, 'document-exported': { type: 'boolean', describe: 'Generate documentation for all exported bindings and members ' + - 'even if there is no JSDoc for them', + 'even if there is no JSDoc for them', default: false }, 'sort-order': {