diff --git a/cli.js b/cli.js index 12bfd97f0233eb33d4a900ee91e74e943f72ee08..d4cf5ff1557e5593b5262e59b8ee468d6440ced4 100644 --- a/cli.js +++ b/cli.js @@ -35,6 +35,7 @@ var argv = require('optimist') .describe('x', 'output JSON Schema files including description and validated examples in the _new folder at output directory') .alias('n', 'no-readme') .describe('n', 'Do not generate a README.md file in the output directory') + .describe('link-*', 'Add this file as a link the explain the * attribute, e.g. --link-abstract=abstract.md') .check(function(args) { if (!fs.existsSync(args.input)) { throw 'Input file "' + args.input + '" does not exist!'; @@ -45,6 +46,9 @@ var argv = require('optimist') }) .argv; +const docs = _.fromPairs(_.toPairs(argv).filter(([ key, value ]) => { return key.startsWith('link-'); }).map(([ key, value ]) => { return [ key.substr(5), value ];})); +console.log(docs); + var ajv = new Ajv({ allErrors: true, messages:true }); ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); var schemaPathMap = {};