{"_id":"cliclopts","_rev":"9-e50e601233ff12110148f20f41c30e53","name":"cliclopts","description":"Command line options helper and usage printer","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"cliclopts","version":"1.0.0","description":"Command line options helper and usage printer","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/finnp/cliclopts.git"},"keywords":["cli","minimist","options"],"author":{"name":"Finn Pauls"},"license":"MIT","bugs":{"url":"https://github.com/finnp/cliclopts/issues"},"homepage":"https://github.com/finnp/cliclopts","gitHead":"4d4dcb9be8749da7a2222965ce63102fcb5e03df","_id":"cliclopts@1.0.0","_shasum":"40b5b4b427ec66e6d493ad3d25f5fd7428772cac","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"finnpauls","email":"derfinn@gmail.com"},"maintainers":[{"name":"finnpauls","email":"derfinn@gmail.com"}],"dist":{"shasum":"40b5b4b427ec66e6d493ad3d25f5fd7428772cac","tarball":"https://registry.npmjs.org/cliclopts/-/cliclopts-1.0.0.tgz","integrity":"sha512-bUjKH54+QG4VpyiDoh1oX+3tNtBIY0NgV48qd3K5MEcmGoP12kPipfch8itA+LEOlflOdp/hKRE60aPl/FX36A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+8eOKR9tJiuuB6SOH2eFRhHwyGS9uLCbq4yUEF2muCgIgATA3N9Vv4qrOMl/2q1055MRxCQM2iM0KfxPvt+XN5P0="}]}},"1.1.0":{"name":"cliclopts","version":"1.1.0","description":"Command line options helper and usage printer","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/finnp/cliclopts.git"},"keywords":["cli","minimist","options"],"author":{"name":"Finn Pauls"},"license":"MIT","bugs":{"url":"https://github.com/finnp/cliclopts/issues"},"homepage":"https://github.com/finnp/cliclopts","gitHead":"0627952a06b452d385df3ba8bd4288696f977dea","_id":"cliclopts@1.1.0","_shasum":"3a94d676d03b646150bbd26a876efef2af1fddd4","_from":".","_npmVersion":"2.5.1","_nodeVersion":"1.3.0","_npmUser":{"name":"finnpauls","email":"derfinn@gmail.com"},"maintainers":[{"name":"finnpauls","email":"derfinn@gmail.com"}],"dist":{"shasum":"3a94d676d03b646150bbd26a876efef2af1fddd4","tarball":"https://registry.npmjs.org/cliclopts/-/cliclopts-1.1.0.tgz","integrity":"sha512-CnceNPrFj400yIKwO8hF+hzNBvnxFMBQ/G44G+tyK/G/GY9gB1mAVttIzywX7uYLfYWKusp5PfN6Q2017tT8pQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDh+cdyyh/4Tho0pW5/Dr+p+6w+BwbIJsPspz8GtZzOVwIgSsVP+NZ58xtDqigD+b9YIW5HexkEzpnSiWsjz+ltfzE="}]}},"1.1.1":{"name":"cliclopts","version":"1.1.1","description":"Command line options helper and usage printer","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/finnp/cliclopts.git"},"keywords":["cli","minimist","options"],"author":{"name":"Finn Pauls"},"license":"MIT","bugs":{"url":"https://github.com/finnp/cliclopts/issues"},"homepage":"https://github.com/finnp/cliclopts","gitHead":"cb2ebec3d20e2e633cce9263d9becd9972531490","_id":"cliclopts@1.1.1","_shasum":"69431c7cb5af723774b0d3911b4c37512431910f","_from":".","_npmVersion":"3.0.0","_nodeVersion":"1.3.0","_npmUser":{"name":"finnpauls","email":"derfinn@gmail.com"},"maintainers":[{"name":"finnpauls","email":"derfinn@gmail.com"},{"name":"maxogden","email":"max@maxogden.com"}],"dist":{"shasum":"69431c7cb5af723774b0d3911b4c37512431910f","tarball":"https://registry.npmjs.org/cliclopts/-/cliclopts-1.1.1.tgz","integrity":"sha512-dJk8y+TJmOy9Kqha0aWN0rwM5E5EQCVjhl2GTz1CrkqzxkQZ26/hyrNmy7lwePdZc4iNcdHL1tTdcIBeNQhmww==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA1pDStYPXYoQpoUUydA/84K/TccxPnA8rursdgxGAaNAiEAlze+AjZFKFY/ue2fMFJvfGOlO2Q85uDeAyeGqDM2nT8="}]}}},"readme":"# cliclopts\n[![NPM](https://nodei.co/npm/cliclopts.png)](https://nodei.co/npm/cliclopts/)\n\n![cliclopts](cliclopts.png)\n\nCommand line options helper and usage printer, works well with [minimist](https://www.npmjs.com/package/minimist), inspired by [nomnom](https://www.npmjs.com/package/nomnom)\n\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n\n## usage\n\nDefine the allowed options in an array and pass it to 'cliclopts'\n\n```js\nvar cliclopts = require('cliclopts')\n\nvar options = [\n  {\n    name: 'verbose',\n    abbr: 'v',\n    alias: ['loud'],\n    boolean: true,\n    help: 'be verbose'\n  },\n  {\n    name: 'path',\n    abbr: 'p',\n    default: './dat.json',\n    help: 'path to file'\n  }\n]\n\nvar cliOpts = cliclopts(options)\n```\n### cliclopts(options)\n\noptions is an array of objects with the following possible keys:\n\n* `name` primary name of option\n* `abbr` one character alias of the option\n* `alias` other options treated as alias\n* `boolean` if true the option is seen as a boolean flag\n* `help` usage string for the option\n* `default` default value of the option\n\n\n### cliOpts.usage()\n\nReturns the usage information as string:\n\n```\n--verbose, -v         be verbose\n--path, -p            path to file (default: \"dat.json\")\n```\n\n### cliOpts.print()\n\nPrints the usage information.\n\n### cliOpts.boolean()\n\nReturns Array of all command names that are specified as boolean.\n\n### cliOpts.alias()\n\nReturns Object with command names as keys and alias list as value (including abbr)\n\n### cliOpts.default()\n\nReturns Object with command names as keys and default values as values.\n\n### cliOpts.options()\n\nReturns\n```js\n{\n  alias: cliOpts.alias(),\n  boolean: cliOpts.boolean(),\n  default: cliOpts.default()\n}\n```\n\n\n## Example usage with `minimist`\n```js\nvar allowedOptions = [\n  {\n    name: 'verbose',\n    abbr: 'v',\n    alias: ['cry-at-me'],\n    boolean: true,\n    help: 'be verbose'\n  },\n  {\n    name: 'path',\n    abbr: 'p',\n    help: 'path to the file'\n  },\n  {\n    name: 'help',\n    abbr: 'h',\n    help: 'show help',\n    boolean: true\n  }\n]\n\nvar cliOpts = require('cliclopts')(allowedOptions)\n\nvar argv = require('minimist')(process.argv.slice(2), cliOpts.options())\n\nif (argv.help) {\n  console.log('Usage: command [options]')\n  cliOpts.print()\n  process.exit()\n}\n\nyourprogram(argv)\n```\n\n","maintainers":[{"name":"finnpauls","email":"derfinn@gmail.com"},{"name":"maxogden","email":"max@maxogden.com"}],"time":{"modified":"2022-06-13T06:09:57.972Z","created":"2014-12-10T03:19:49.796Z","1.0.0":"2014-12-10T03:19:49.796Z","1.1.0":"2015-04-01T01:01:09.200Z","1.1.1":"2015-07-07T19:22:13.495Z"},"homepage":"https://github.com/finnp/cliclopts","keywords":["cli","minimist","options"],"repository":{"type":"git","url":"git+https://github.com/finnp/cliclopts.git"},"author":{"name":"Finn Pauls"},"bugs":{"url":"https://github.com/finnp/cliclopts/issues"},"license":"MIT","readmeFilename":"readme.md","users":{"emilbay":true,"ctesniere":true}}