From 6b4d5c5d75c6c7bd77c773a03bc173689e647e4f Mon Sep 17 00:00:00 2001 From: amano <1060996790@qq.com> Date: Sat, 22 Aug 2020 17:18:35 +0800 Subject: [PATCH] support multi input --- bin.js | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/bin.js b/bin.js index c5d66bf..1203b40 100755 --- a/bin.js +++ b/bin.js @@ -16,11 +16,21 @@ const commander = require('commander'); // include commander in git clone of com const program = new commander.Command(); program - .option('-v, --verbose', 'erbose debug output.', false) - .option('-i, --input ', 'input dir', []) + .option('-i, --input ', 'input dir', collect, []) .option('-o, --output ', 'enable verbose', 'doc') + .option('-c, --config ', 'Path to config file or to directory containing config file (apidoc.json or apidoc.config.js).', '') + + .option('--definitions', 'Include definitions file rather than copying definitions.', false) + + .option('-p, --private', 'Include private APIs in output.', false) + + .option('-v, --verbose', 'Verbose debug output.', false) + .option('-d, --debug', 'Show debug messages.', false) - .option('-c, --color', 'Show color', true) + + .option('--color', 'Turn off log color.', true) + + // .option('--parse', 'Parse only the files and return the data, no file creation.', false) .option('-p, --parsee', 'Parse only the files and return the data, no file creation', false) .option('-s, --simulate', 'Execute but not write any file.', false) @@ -33,6 +43,18 @@ const options = { } console.log('options', options); + +/** + * Collect options into an array + * @param {String} value + * @param {String[]} acc + * @returns {String[]} + */ +function collect(value, acc) { + acc.push(value); + return acc; +} + const { main } = require('./lib')