{"_id":"subcommand","_rev":"20-4472d5b57c02635c7771648dec50ca39","name":"subcommand","description":"create CLI tools with subcommands","dist-tags":{"latest":"2.1.1"},"versions":{"1.0.0":{"name":"subcommand","version":"1.0.0","description":"create CLI tools with subcommands","main":"index.js","scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"https://github.com/maxogden/subcommand.git"},"keywords":["minimist"],"author":{"name":"max ogden"},"license":"BSD","bugs":{"url":"https://github.com/maxogden/subcommand/issues"},"homepage":"https://github.com/maxogden/subcommand","dependencies":{"cliclopts":"^1.1.0","debug":"^2.1.3","minimist":"^1.1.1"},"gitHead":"a69f8392f6df78ca049b6d262e460e183c38c26a","_id":"subcommand@1.0.0","_shasum":"fe073d7b74830b13b232c82b3faa4f8ac95435c9","_from":".","_npmVersion":"2.7.0","_nodeVersion":"1.5.1","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}],"dist":{"shasum":"fe073d7b74830b13b232c82b3faa4f8ac95435c9","tarball":"https://registry.npmjs.org/subcommand/-/subcommand-1.0.0.tgz","integrity":"sha512-2kr9NTxtatlHIF7sOhsjel8UVN7qyuVfI2ZZ405rWrVgPnZRAee67s9MZl/8VnYV1Zq/ewLkntpo5QkTS1mIsQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA6XDJSZeMG0zfgbkjkpqjDpeBzplF038dW3hAOeP3xaAiA4ly3cbLTDdPscHhYAafFdJWJmMxCziDtH2/ZqSX2K3w=="}]},"directories":{}},"1.0.1":{"name":"subcommand","version":"1.0.1","description":"create CLI tools with subcommands","main":"index.js","scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"https://github.com/maxogden/subcommand.git"},"keywords":["minimist"],"author":{"name":"max ogden"},"license":"BSD","bugs":{"url":"https://github.com/maxogden/subcommand/issues"},"homepage":"https://github.com/maxogden/subcommand","dependencies":{"cliclopts":"^1.1.0","debug":"^2.1.3","minimist":"^1.1.1"},"devDependencies":{"standard":"^3.3.2"},"gitHead":"b5bc54c9d25218abcf3bff5f7040360dfcd6fcb8","_id":"subcommand@1.0.1","_shasum":"aa2e7286df19da6fa9255446ec16c6bfb3e4a6b5","_from":".","_npmVersion":"2.7.0","_nodeVersion":"1.5.1","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}],"dist":{"shasum":"aa2e7286df19da6fa9255446ec16c6bfb3e4a6b5","tarball":"https://registry.npmjs.org/subcommand/-/subcommand-1.0.1.tgz","integrity":"sha512-GnWD9RSo1MglT7LxErTy8OEfL/lwt6FnMWOG6m1CcaVpzdcqUZFE0uq2z/GUrBYaTCICY/3TwzF3N++tGO8DaQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZgkxGHHWFL/sXj2Jp0RKk5576F8cazIaN7iVPfjrqUAiEAqGS+QYZYtoIRXmquHTENquFA+/gphre2Xh7qIUa3rEY="}]},"directories":{}},"1.1.0":{"name":"subcommand","version":"1.1.0","description":"create CLI tools with subcommands","main":"index.js","scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"https://github.com/maxogden/subcommand.git"},"keywords":["minimist"],"author":{"name":"max ogden"},"license":"BSD","bugs":{"url":"https://github.com/maxogden/subcommand/issues"},"homepage":"https://github.com/maxogden/subcommand","dependencies":{"cliclopts":"^1.1.0","debug":"^2.1.3","minimist":"^1.1.1","xtend":"^4.0.0"},"devDependencies":{"standard":"^3.3.2","tape":"^4.0.0"},"gitHead":"9c07713fdda2af499683673534497d83618f9384","_id":"subcommand@1.1.0","_shasum":"44cc106575733113cc2da8328d0d7528a3533904","_from":".","_npmVersion":"2.7.0","_nodeVersion":"1.5.1","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}],"dist":{"shasum":"44cc106575733113cc2da8328d0d7528a3533904","tarball":"https://registry.npmjs.org/subcommand/-/subcommand-1.1.0.tgz","integrity":"sha512-3oH+aisPGTr7KS4dfdkxYlbP8cqvaZfgyv/3UcQx2gwdSePoDkZCZF4H+a87CX2C5Cbb1/KUTLcl8tGSfdr0xg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjkp4BwNbNck2yFNRNJgs09UvPZKuXPHEWXXan0kCxhgIhAPb+Qf0ZkBWtw2DrgrGm0gewO6H2XVuFFXpVqiBWWek2"}]},"directories":{}},"1.1.1":{"name":"subcommand","version":"1.1.1","description":"create CLI tools with subcommands","main":"index.js","scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"https://github.com/maxogden/subcommand.git"},"keywords":["minimist"],"author":{"name":"max ogden"},"license":"BSD","bugs":{"url":"https://github.com/maxogden/subcommand/issues"},"homepage":"https://github.com/maxogden/subcommand","dependencies":{"cliclopts":"^1.1.0","debug":"^2.1.3","minimist":"^1.1.1","xtend":"^4.0.0"},"devDependencies":{"standard":"^3.3.2","tape":"^4.0.0"},"gitHead":"5c3be69ba133eea58784e90b905f8260c4f4d84c","_id":"subcommand@1.1.1","_shasum":"c6c2e11a85906f8853470d4b8f40dda7cc8e1e00","_from":".","_npmVersion":"2.7.0","_nodeVersion":"1.5.1","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}],"dist":{"shasum":"c6c2e11a85906f8853470d4b8f40dda7cc8e1e00","tarball":"https://registry.npmjs.org/subcommand/-/subcommand-1.1.1.tgz","integrity":"sha512-EBfjK3S9P/9EO1XFbOJ5hNeP4knocmDvRmJEmLTa4t8d4bcTpAkdctbCMZyBYwN0ScbmylcqHvxRss4skz0lGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTm7Olr1NIuRlzU2sSsXl8zWgA8Nqv24fg5d+atgoL1QIhANvWWU513KBBbxheioTewzX1nmxc36y87DZXZgPNGwh5"}]},"directories":{}},"2.0.0":{"name":"subcommand","version":"2.0.0","description":"create CLI tools with subcommands","main":"index.js","scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"https://github.com/maxogden/subcommand.git"},"keywords":["minimist"],"author":{"name":"max ogden"},"license":"BSD","bugs":{"url":"https://github.com/maxogden/subcommand/issues"},"homepage":"https://github.com/maxogden/subcommand","dependencies":{"cliclopts":"^1.1.0","debug":"^2.1.3","minimist":"^1.1.1","xtend":"^4.0.0"},"devDependencies":{"standard":"^3.3.2","tape":"^4.0.0"},"gitHead":"39d66ee8766945bcb97757eea30ba5e2b64a46d2","_id":"subcommand@2.0.0","_shasum":"0bff42ffa3ccf777368a217de265a8a04e9c33d5","_from":".","_npmVersion":"2.7.0","_nodeVersion":"1.5.1","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}],"dist":{"shasum":"0bff42ffa3ccf777368a217de265a8a04e9c33d5","tarball":"https://registry.npmjs.org/subcommand/-/subcommand-2.0.0.tgz","integrity":"sha512-/6giBINptWVJH+o9qlLpYjNq+OHHQLfK5+oy1SFWvMO9oM7fEtAwgwfAtRDPHRo4KXCs0/KQLtX29ShSzQ5caQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAddY+Jm0SwfXafqNoKlPa1HlWaLfmG3YZB3ngVxnSn3AiEApGwFb7zDLYkrr/7EQiFxk4Y02zYAN4ARilNO7VcB8+g="}]},"directories":{}},"2.0.1":{"name":"subcommand","version":"2.0.1","description":"create CLI tools with subcommands","main":"index.js","scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"https://github.com/maxogden/subcommand.git"},"keywords":["minimist"],"author":{"name":"max ogden"},"license":"BSD","bugs":{"url":"https://github.com/maxogden/subcommand/issues"},"homepage":"https://github.com/maxogden/subcommand","dependencies":{"cliclopts":"^1.1.0","debug":"^2.1.3","minimist":"^1.1.1","xtend":"^4.0.0"},"devDependencies":{"standard":"^3.3.2","tape":"^4.0.0"},"gitHead":"0cbb92aca86bb81fa92ab042fb7b73301f990e57","_id":"subcommand@2.0.1","_shasum":"1b9fd534a0311a05030f118c6b546a23ccac2431","_from":".","_npmVersion":"2.7.0","_nodeVersion":"1.5.1","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}],"dist":{"shasum":"1b9fd534a0311a05030f118c6b546a23ccac2431","tarball":"https://registry.npmjs.org/subcommand/-/subcommand-2.0.1.tgz","integrity":"sha512-QCGsdjHg/FSPEI7Htu8Ltqdi74lPfhZDRtlM+31OMliAekt/5jhKT8VmHB0cfryJgBw5xGtLITf1LrBZ0zdlag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMU4hBC46P9fVqeQyS4f9tmgRLvIKFEYhG08LpH+Cu2gIhAI84umvhoPyIsP1cMpbcOJSuNV2H+B/Kkk7HBY8EaOFh"}]},"directories":{}},"2.0.2":{"name":"subcommand","version":"2.0.2","description":"create CLI tools with subcommands","main":"index.js","scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"git+https://github.com/maxogden/subcommand.git"},"keywords":["minimist"],"author":{"name":"max ogden"},"license":"BSD","bugs":{"url":"https://github.com/maxogden/subcommand/issues"},"homepage":"https://github.com/maxogden/subcommand","dependencies":{"cliclopts":"^1.1.0","debug":"^2.1.3","minimist":"^1.1.1","xtend":"^4.0.0"},"devDependencies":{"standard":"^3.3.2","tape":"^4.0.0"},"gitHead":"eedf5dccaef8ce9895834c8292605c7ccb19eeb6","_id":"subcommand@2.0.2","_shasum":"ead494c778452374d74189ed32a9291c1a68350a","_from":".","_npmVersion":"2.9.0","_nodeVersion":"1.8.2","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"}],"dist":{"shasum":"ead494c778452374d74189ed32a9291c1a68350a","tarball":"https://registry.npmjs.org/subcommand/-/subcommand-2.0.2.tgz","integrity":"sha512-VyjUc/yWleVia0TE3qzdPO64OK8GhxuDypjPV7W7GGgMZYCrAP27DsfP3a7pMLEVXL/6SB012eTDgpd5TcnhWg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGNDJtezVWbgebD19vde4pUxzzzxxXnDFMR1ONjjoV3hAiB/7CB0ubk/57iIrU0PMs9bOYjNIiVOJnfVI4MtA1mBJg=="}]},"directories":{}},"2.0.3":{"name":"subcommand","version":"2.0.3","description":"create CLI tools with subcommands","main":"index.js","scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"git+https://github.com/maxogden/subcommand.git"},"keywords":["minimist"],"author":{"name":"max ogden"},"license":"BSD","bugs":{"url":"https://github.com/maxogden/subcommand/issues"},"homepage":"https://github.com/maxogden/subcommand","dependencies":{"cliclopts":"^1.1.0","debug":"^2.1.3","minimist":"^1.2.0","xtend":"^4.0.0"},"devDependencies":{"standard":"^3.3.2","tape":"^4.0.0"},"gitHead":"b7e2901afddec02ec2c9361a9d39bd785e10e329","_id":"subcommand@2.0.3","_shasum":"9b3fd1a753e3c441f00410cb44131d8655f52c32","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"dist":{"shasum":"9b3fd1a753e3c441f00410cb44131d8655f52c32","tarball":"https://registry.npmjs.org/subcommand/-/subcommand-2.0.3.tgz","integrity":"sha512-ZxOpTeqDDgqToOCPpEkNDePkbnmJAb3T9ossa8F5eAk3V2UsJJAJZm6N5AB8XAMquTen00Ka6jGLDwhWdxkj6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAezJttCbWTmn9ZoFzbKEx73SAOt0jqz3vtEFE+SddsJAiAG3XMEdWoo3IeFw3YgDjnztzZI/h7aAKtV89yvk9G2rw=="}]},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"},{"name":"karissa","email":"krmckelv@gmail.com"}],"directories":{}},"2.0.4":{"name":"subcommand","version":"2.0.4","description":"create CLI tools with subcommands","main":"index.js","scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"git+https://github.com/maxogden/subcommand.git"},"keywords":["minimist"],"author":{"name":"max ogden"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/maxogden/subcommand/issues"},"homepage":"https://github.com/maxogden/subcommand","dependencies":{"cliclopts":"^1.1.0","debug":"^2.1.3","minimist":"^1.2.0","xtend":"^4.0.0"},"devDependencies":{"standard":"^3.3.2","tape":"^4.0.0"},"gitHead":"b0fcb7b3858aadcdc2e921ddc96c73326cb4f0da","_id":"subcommand@2.0.4","_shasum":"71cd54bd83a78a0b266296cda3f9428e91d66b14","_from":".","_npmVersion":"2.14.15","_nodeVersion":"4.2.3","_npmUser":{"name":"maxogden","email":"max@maxogden.com"},"dist":{"shasum":"71cd54bd83a78a0b266296cda3f9428e91d66b14","tarball":"https://registry.npmjs.org/subcommand/-/subcommand-2.0.4.tgz","integrity":"sha512-eWIKJI7Iy+XRT4m1bitmlfItIitCXfJqeNyzSZZFD0KhqWLygsmWbKVNdFV9NYv2/xzj+0Z3td14QyYNSZE+Aw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHN1a2huhWMbjGAMQydPL8a0K1uD31KRGVuFELr9vCWQAiEA/oujZ5IJysj57HWRHt8wLPGGxmIXHFC3McDRtlmcuT4="}]},"maintainers":[{"name":"maxogden","email":"max@maxogden.com"},{"name":"karissa","email":"krmckelv@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/subcommand-2.0.4.tgz_1476422215183_0.25847367220558226"},"directories":{}},"2.1.0":{"name":"subcommand","version":"2.1.0","description":"create CLI tools with subcommands","main":"index.js","scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"git+https://github.com/maxogden/subcommand.git"},"keywords":["minimist"],"author":{"name":"max ogden"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/maxogden/subcommand/issues"},"homepage":"https://github.com/maxogden/subcommand","dependencies":{"cliclopts":"^1.1.0","debug":"^2.1.3","minimist":"^1.2.0","xtend":"^4.0.0"},"devDependencies":{"standard":"^3.3.2","tape":"^4.0.0"},"gitHead":"6b9bdab1097dfe5cf3bf56c31b164e8de2c5546c","_id":"subcommand@2.1.0","_shasum":"5e4ceca5a3779e3365b1511e05f866877302f760","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"jhand","email":"joe@hand.email"},"dist":{"shasum":"5e4ceca5a3779e3365b1511e05f866877302f760","tarball":"https://registry.npmjs.org/subcommand/-/subcommand-2.1.0.tgz","integrity":"sha512-Ysvx9WXMgocJd953WJYoXn1cFv5XkhMq5U5Kp5cjEr5Au/bldZ0qBP9ido3gYn+4vzuGRrnfilMdCuF7FbQn4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE+vUXKgM1+gGh1NEq6OgqcSMxqyznKJibqlRUht6JL+AiB7e+SpqzbH0EjJs8DOuWnHO30PZHuMd+BlNitZDpUSCQ=="}]},"maintainers":[{"name":"jhand","email":"joe@hand.email"},{"name":"karissa","email":"krmckelv@gmail.com"},{"name":"maxogden","email":"max@maxogden.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/subcommand-2.1.0.tgz_1484780275948_0.4761809688061476"},"directories":{}},"2.1.1":{"name":"subcommand","version":"2.1.1","description":"create CLI tools with subcommands","main":"index.js","scripts":{"test":"standard && node test.js"},"repository":{"type":"git","url":"git+https://github.com/maxogden/subcommand.git"},"keywords":["minimist"],"author":{"name":"max ogden"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/maxogden/subcommand/issues"},"homepage":"https://github.com/maxogden/subcommand","dependencies":{"cliclopts":"^1.1.0","debug":"^4.1.1","minimist":"^1.2.0"},"devDependencies":{"standard":"^12.0.1","tape":"^4.0.0"},"gitHead":"5248f6f7cd44dbfe09928d1f1ff98f4b682683e4","_id":"subcommand@2.1.1","_nodeVersion":"10.2.1","_npmVersion":"6.8.0","dist":{"integrity":"sha512-cm7TQq9I8dA5LKUr+r8W7RzQlLsmTdCr6wXmjYueOoh/bQu55ODEw7GFhT42pUyoaLtO2rgmx1+8cSIjY9lR9g==","shasum":"66ba790cc72564049eface644c4a24291a4829c7","tarball":"https://registry.npmjs.org/subcommand/-/subcommand-2.1.1.tgz","fileCount":6,"unpackedSize":17040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceXAdCRA9TVsSAnZWagAAnQsQAI2YfGeKjTzOmqcAPbvo\niqTb44SfcKGjG+baNgST1f43lPDikZTWoxxc3/lbcZsprTtgDC5Bp6ISMi+o\ndZ9CxsC3BSJ/Gm+ktnHA2K/W5DiYPzTUV7pO+Ebb1u8zDBHIFoMMapD8yD8W\nXNIzcGRSFA/4g+9LFCCI6+QQLIimtxpIW5XjVpeyzFT33WXcADDuHDudJQ3O\nu9H1cQS5TynN7IGlSOofPbUXkxJKjNy2vmtE/9rQ5i5FFO7CZ/uxcJ/knWI8\nLAg2h9Rh83o41SkjbT+pdptWdYa/j3sDjW4aaMXql73EUlHYehedk3GkuPgO\nMiXdMLYDrdga7m6pZRaPkRaFT2OWf9GRD5/Ml8+Bj+2FQHWOM4vv7qTpyJyo\naDU0i8AzQhoZtNNC5goPj0nEpC2S4R9449h6z4NkROsYnfO/TwMxISxePymj\nR28S5y+uIGlxBqZorAYtH1WllbKxxrJ24FZ216uHNH7vQ5o9g5+eUA9JRCeg\nqBrNFi6IzLK6iEz9g+ZLMeo7JXIWgNQAB1DsRk3B8uGqGJ6t7IprCbmIZnGK\nOrLRsuAGM+shSOAI5HvokR0obXXbImdsHtPe4bxLlbvw0LT+bY2u9JEAFNvz\n5UDGi/x3gLhp6orOE8sULfaLuMmHzGMBxAKHTXSuZZhDrDtxtKWVEL3o/GMs\nhvsM\r\n=IKr8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpJpfRVydtU3wrt61+iGkXUxwFkPcmH/nXVU8y4RTEUAIgeF/+o6vcRRzqXD1bMRUYi49X8sFHEVTwjLj/qQcbvtk="}]},"maintainers":[{"name":"jhand","email":"joe@hand.email"},{"name":"karissa","email":"krmckelv@gmail.com"},{"name":"maxogden","email":"max@maxogden.com"}],"_npmUser":{"name":"jhand","email":"joe@hand.email"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/subcommand_2.1.1_1551462429155_0.5090764485243522"},"_hasShrinkwrap":false}},"readme":"# subcommand\n\nCreate CLI tools with subcommands. A minimalist CLI router based on [minimist](https://www.npmjs.com/package/minimist) and [cliclopts](https://www.npmjs.com/package/cliclopts).\n\n[![NPM](https://nodei.co/npm/subcommand.png)](https://nodei.co/npm/subcommand/)\n\n[![js-standard-style](https://raw.githubusercontent.com/feross/standard/master/badge.png)](https://github.com/feross/standard)\n\n[![Build Status](https://travis-ci.org/maxogden/subcommand.svg?branch=master)](https://travis-ci.org/maxogden/subcommand)\n\n## basic usage\n\nfirst, define your CLI API in JSON like this:\n\n```js\nvar commands = [\n  {\n    name: 'foo',\n    options: [ // cliclopts options\n      {\n        name: 'loud',\n        boolean: true,\n        default: false,\n        abbr: 'v',\n        help: 'print out all output loudly'\n      }\n    ],\n    command: function foo (args) {\n      // called when `foo` is matched\n    }\n  },\n  {\n    name: 'bar',\n    command: function bar (args) {\n      // called when `bar` is matched\n    }\n  }\n]\n```\n\nthen pass them into `subcommand`:\n\n```js\nvar subcommand = require('subcommand')\nvar match = subcommand(config, opts)\n```\n\n`subcommand` returns a function (called `match` above) that you can use to match/route arguments to their subcommands\n\nthe return value will be `true` if a subcommand was matched, or `false` if no subcommand was matched\n\n```js\nvar matched = match(['foo'])\n// matched will be true, and foo's `command` function will be called\n\nvar matched = match(['foo', 'baz', 'taco'])\n// matched will be true, and foo's `command` function will be called with `['baz', 'taco']`\n\nvar matched = match(['bar'])\n// matched will be true, and bar's `command` function will be called\n\nvar matched = match(['uhoh'])\n// matched will be false\n```\n\n## advanced usage\n\ninstead of an array, you can also pass an object that looks like this as the first argument to `subcommand`:\n\n```\n{\n  root: // root command options and handler\n  defaults: // default options\n  all: // function that gets called always, regardless of match or no match\n  none: // function that gets called only when there is no matched subcommand\n  usage: // subcommand to use for printing usage\n  commands: // the commands array from basic usage\n}\n```\n\nsee `test.js` for a concrete example\n\n### root\n\nto pass options to the 'root' command (e.g. when no subcommand is passed in), set up your config like this:\n\n```js\nvar config = {\n  root: {\n    options: [ // cliclopts options\n      {\n        name: 'loud',\n        boolean: true,\n        default: false,\n        abbr: 'v'\n      }\n    ],\n    command: function (args) {\n      // called when no subcommand is specified\n    }\n  },\n  commands: yourSubCommandsArray\n}\n```\n\n### defaults\n\nyou can pass in a defaults options array, and all subcommands as well as the root command will inherit the default options\n\n```js\nvar config = {\n  defaults: [\n    {name: 'path', default: process.cwd()} // all commands (and root) will now always have a 'path' default option\n  ],\n  commands: yourSubCommandsArray\n}\n```\n\n### all\n\npass a function under the `all` key and it will get called with the parsed arguments 100% of the time\n\n```js\nvar config = {\n  all: function all (args) { /** will be called always in addition to the command/root `command` handlers **/ },\n  commands: yourSubCommandsArray\n}\n```\n\n### none\n\npass a function under the `none` key and it will get called when no subcommand is matched\n\n```js\nvar config = {\n  none: function none (args) { /** will only be called when no subcommand is matched **/ },\n  commands: yourSubCommandsArray\n}\n```\n\n### usage\n\nThe `usage` option makes it easy to print [cliclops usage](https://github.com/finnp/cliclopts#clioptsusage) for the root command and subcommands.\n\n#### Basic usage\n\nBy default, usage is printed with the `--help` or `-h` option. Set usage to true to print `cliclops.usage()` with `--help`:\n\n```js\nvar config = {\n  usage: true\n}\n```\n\nUse `usage.help` to print information above `cliclops.usage()`. Change the name of the usage option by specifying `usage.option`:\n\n```js\nvar config = {\n  usage: {\n    help: 'general usage info',\n    option: {\n      name: 'info',\n      abbr: 'i'\n    }\n  }\n}\n```\n\nThis will print the usage with `--info` or `-i` instead of `--help`. The option is used for the root and subcommands.\n\n#### Advanced Usage\n\nYou can also define custom usage functions for the root and subcommands. These are passed the help text and `cliclops.usage()`.\n\n```js\nvar config = {\n  usage: {\n    help: 'general help message', // Message to print before cliclops.usage()\n    option: {\n      // minimist option to use for printing usage\n      name: 'help',\n      abbr: 'h'\n    },\n    command: function (args, help, usage) {\n      // optional function to print usage. \n      console.log(help) // prints: \"general help message\"\n      console.log(usage) // prints: cliclops.usage() \n    }\n  },\n  commands: [{\n    name: 'foo',\n    help: 'foo help message',\n    options: [\n      {\n        name: 'loud',\n        help: 'print out all output loudly'\n      }\n    ],\n    usage: function (args, help, usage) {\n      // called when `foo` is matched and --help option is used\n      console.log(help) // prints: \"foo help message\"\n      console.log(usage) // prints: cliclops.usage()\n    },\n    command: function foo (args) {\n      // called when `foo` is matched\n    }\n  }]\n}\n```\n","maintainers":[{"name":"jhand","email":"joe@hand.email"},{"name":"karissa","email":"krmckelv@gmail.com"},{"name":"maxogden","email":"max@maxogden.com"}],"time":{"modified":"2022-06-27T01:45:47.616Z","created":"2015-04-05T03:59:35.581Z","1.0.0":"2015-04-05T03:59:35.581Z","1.0.1":"2015-04-05T04:02:01.051Z","1.1.0":"2015-04-06T23:44:43.163Z","1.1.1":"2015-04-07T04:42:30.316Z","2.0.0":"2015-04-07T18:02:48.067Z","2.0.1":"2015-04-07T18:13:27.596Z","2.0.2":"2015-06-12T17:57:14.275Z","2.0.3":"2015-08-25T17:25:13.394Z","2.0.4":"2016-10-14T05:16:55.408Z","2.1.0":"2017-01-18T22:57:57.721Z","2.1.1":"2019-03-01T17:47:09.272Z"},"homepage":"https://github.com/maxogden/subcommand","keywords":["minimist"],"repository":{"type":"git","url":"git+https://github.com/maxogden/subcommand.git"},"author":{"name":"max ogden"},"bugs":{"url":"https://github.com/maxogden/subcommand/issues"},"license":"BSD-2-Clause","readmeFilename":"readme.md","users":{"julien-f":true,"ctesniere":true}}