{"action":"created","comment":{"url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/pulls/comments/37201695","id":37201695,"diff_hunk":"@@ -33,8 +38,10 @@ Plugins.prototype = Emitter({\n       next = opts;\n       opts = null;\n     }\n-    argv = this.minimist(argv, opts);\n-    this.plugins.run(argv, function (err, args) {","path":"index.js","position":26,"original_position":26,"commit_id":"60d97b393f2fdc2a059836c9919bfc7d02288112","original_commit_id":"13ce371ae31682d1bf93b55fc01b31713d9bc6a6","user":{"login":"doowb","id":995160,"avatar_url":"https://avatars.githubusercontent.com/u/995160?v=3","gravatar_id":"","url":"https://api.github.com/users/doowb","html_url":"https://github.com/doowb","followers_url":"https://api.github.com/users/doowb/followers","following_url":"https://api.github.com/users/doowb/following{/other_user}","gists_url":"https://api.github.com/users/doowb/gists{/gist_id}","starred_url":"https://api.github.com/users/doowb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doowb/subscriptions","organizations_url":"https://api.github.com/users/doowb/orgs","repos_url":"https://api.github.com/users/doowb/repos","events_url":"https://api.github.com/users/doowb/events{/privacy}","received_events_url":"https://api.github.com/users/doowb/received_events","type":"User","site_admin":false},"body":"I think it'll be correct to just remove the `merge` part of this code and pass the `opts` directly to `minimist` since this will be used like... `cli.parse(process.argv.slice(2), { ... })` and be like using `minimist` directly. The original `this.options` are available to the plugins when `fn(this)` is called inside `use`. If plugins need additional options for themselves, then they would use a pattern like:\r\n\r\n```js\r\nmodule.exports = function pluginWrapper (options) {\r\n  options = options || {};\r\n  return function plugin (cli) {\r\n    // cli is `this` from `minimist-plugins`\r\n    var opts = merge({}, cli.options, options);\r\n    return function (argv, next) {\r\n      next(null, argv);\r\n    };\r\n  };\r\n};\r\n```","created_at":"2015-08-17T15:46:21Z","updated_at":"2015-08-17T15:46:21Z","html_url":"https://github.com/jonschlinkert/minimist-plugins/pull/4#discussion_r37201695","pull_request_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/jonschlinkert/minimist-plugins/pulls/comments/37201695"},"html":{"href":"https://github.com/jonschlinkert/minimist-plugins/pull/4#discussion_r37201695"},"pull_request":{"href":"https://api.github.com/repos/jonschlinkert/minimist-plugins/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/pulls/4","id":42521106,"html_url":"https://github.com/jonschlinkert/minimist-plugins/pull/4","diff_url":"https://github.com/jonschlinkert/minimist-plugins/pull/4.diff","patch_url":"https://github.com/jonschlinkert/minimist-plugins/pull/4.patch","issue_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/issues/4","number":4,"state":"open","locked":false,"title":"stuff, more tests, fix singleton, optional done callback","user":{"login":"tunnckoCore","id":5038030,"avatar_url":"https://avatars.githubusercontent.com/u/5038030?v=3","gravatar_id":"","url":"https://api.github.com/users/tunnckoCore","html_url":"https://github.com/tunnckoCore","followers_url":"https://api.github.com/users/tunnckoCore/followers","following_url":"https://api.github.com/users/tunnckoCore/following{/other_user}","gists_url":"https://api.github.com/users/tunnckoCore/gists{/gist_id}","starred_url":"https://api.github.com/users/tunnckoCore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tunnckoCore/subscriptions","organizations_url":"https://api.github.com/users/tunnckoCore/orgs","repos_url":"https://api.github.com/users/tunnckoCore/repos","events_url":"https://api.github.com/users/tunnckoCore/events{/privacy}","received_events_url":"https://api.github.com/users/tunnckoCore/received_events","type":"User","site_admin":false},"body":"Separated as possible. Hope you like it. :)\r\n\r\nAnd thanks to that my want for merging options, i realized that singleton is broken, so fixed it.","created_at":"2015-08-15T15:44:21Z","updated_at":"2015-08-17T15:46:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a8687bd33c0239cb130bec214f047d45518da27","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/pulls/4/commits","review_comments_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/pulls/4/comments","review_comment_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/issues/4/comments","statuses_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/statuses/60d97b393f2fdc2a059836c9919bfc7d02288112","head":{"label":"chorks:master","ref":"master","sha":"60d97b393f2fdc2a059836c9919bfc7d02288112","user":{"login":"chorks","id":12266426,"avatar_url":"https://avatars.githubusercontent.com/u/12266426?v=3","gravatar_id":"","url":"https://api.github.com/users/chorks","html_url":"https://github.com/chorks","followers_url":"https://api.github.com/users/chorks/followers","following_url":"https://api.github.com/users/chorks/following{/other_user}","gists_url":"https://api.github.com/users/chorks/gists{/gist_id}","starred_url":"https://api.github.com/users/chorks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chorks/subscriptions","organizations_url":"https://api.github.com/users/chorks/orgs","repos_url":"https://api.github.com/users/chorks/repos","events_url":"https://api.github.com/users/chorks/events{/privacy}","received_events_url":"https://api.github.com/users/chorks/received_events","type":"Organization","site_admin":false},"repo":{"id":40764890,"name":"minimist-plugins","full_name":"chorks/minimist-plugins","owner":{"login":"chorks","id":12266426,"avatar_url":"https://avatars.githubusercontent.com/u/12266426?v=3","gravatar_id":"","url":"https://api.github.com/users/chorks","html_url":"https://github.com/chorks","followers_url":"https://api.github.com/users/chorks/followers","following_url":"https://api.github.com/users/chorks/following{/other_user}","gists_url":"https://api.github.com/users/chorks/gists{/gist_id}","starred_url":"https://api.github.com/users/chorks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chorks/subscriptions","organizations_url":"https://api.github.com/users/chorks/orgs","repos_url":"https://api.github.com/users/chorks/repos","events_url":"https://api.github.com/users/chorks/events{/privacy}","received_events_url":"https://api.github.com/users/chorks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chorks/minimist-plugins","description":"Simple wrapper to make minimist, yargs and nopt pluggable. ~20 sloc.","fork":true,"url":"https://api.github.com/repos/chorks/minimist-plugins","forks_url":"https://api.github.com/repos/chorks/minimist-plugins/forks","keys_url":"https://api.github.com/repos/chorks/minimist-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chorks/minimist-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chorks/minimist-plugins/teams","hooks_url":"https://api.github.com/repos/chorks/minimist-plugins/hooks","issue_events_url":"https://api.github.com/repos/chorks/minimist-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/chorks/minimist-plugins/events","assignees_url":"https://api.github.com/repos/chorks/minimist-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/chorks/minimist-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/chorks/minimist-plugins/tags","blobs_url":"https://api.github.com/repos/chorks/minimist-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chorks/minimist-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chorks/minimist-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/chorks/minimist-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chorks/minimist-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/chorks/minimist-plugins/languages","stargazers_url":"https://api.github.com/repos/chorks/minimist-plugins/stargazers","contributors_url":"https://api.github.com/repos/chorks/minimist-plugins/contributors","subscribers_url":"https://api.github.com/repos/chorks/minimist-plugins/subscribers","subscription_url":"https://api.github.com/repos/chorks/minimist-plugins/subscription","commits_url":"https://api.github.com/repos/chorks/minimist-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/chorks/minimist-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/chorks/minimist-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/chorks/minimist-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/chorks/minimist-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/chorks/minimist-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chorks/minimist-plugins/merges","archive_url":"https://api.github.com/repos/chorks/minimist-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chorks/minimist-plugins/downloads","issues_url":"https://api.github.com/repos/chorks/minimist-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/chorks/minimist-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/chorks/minimist-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/chorks/minimist-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chorks/minimist-plugins/labels{/name}","releases_url":"https://api.github.com/repos/chorks/minimist-plugins/releases{/id}","created_at":"2015-08-15T14:40:03Z","updated_at":"2015-08-17T12:16:51Z","pushed_at":"2015-08-17T12:16:00Z","git_url":"git://github.com/chorks/minimist-plugins.git","ssh_url":"git@github.com:chorks/minimist-plugins.git","clone_url":"https://github.com/chorks/minimist-plugins.git","svn_url":"https://github.com/chorks/minimist-plugins","homepage":"","size":130,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jonschlinkert:master","ref":"master","sha":"d4c3bc13c7351f9542a2907918d7e8c6869b1ded","user":{"login":"jonschlinkert","id":383994,"avatar_url":"https://avatars.githubusercontent.com/u/383994?v=3","gravatar_id":"","url":"https://api.github.com/users/jonschlinkert","html_url":"https://github.com/jonschlinkert","followers_url":"https://api.github.com/users/jonschlinkert/followers","following_url":"https://api.github.com/users/jonschlinkert/following{/other_user}","gists_url":"https://api.github.com/users/jonschlinkert/gists{/gist_id}","starred_url":"https://api.github.com/users/jonschlinkert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonschlinkert/subscriptions","organizations_url":"https://api.github.com/users/jonschlinkert/orgs","repos_url":"https://api.github.com/users/jonschlinkert/repos","events_url":"https://api.github.com/users/jonschlinkert/events{/privacy}","received_events_url":"https://api.github.com/users/jonschlinkert/received_events","type":"User","site_admin":false},"repo":{"id":40222112,"name":"minimist-plugins","full_name":"jonschlinkert/minimist-plugins","owner":{"login":"jonschlinkert","id":383994,"avatar_url":"https://avatars.githubusercontent.com/u/383994?v=3","gravatar_id":"","url":"https://api.github.com/users/jonschlinkert","html_url":"https://github.com/jonschlinkert","followers_url":"https://api.github.com/users/jonschlinkert/followers","following_url":"https://api.github.com/users/jonschlinkert/following{/other_user}","gists_url":"https://api.github.com/users/jonschlinkert/gists{/gist_id}","starred_url":"https://api.github.com/users/jonschlinkert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonschlinkert/subscriptions","organizations_url":"https://api.github.com/users/jonschlinkert/orgs","repos_url":"https://api.github.com/users/jonschlinkert/repos","events_url":"https://api.github.com/users/jonschlinkert/events{/privacy}","received_events_url":"https://api.github.com/users/jonschlinkert/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jonschlinkert/minimist-plugins","description":"Simple wrapper to make minimist pluggable. ~20 sloc.","fork":false,"url":"https://api.github.com/repos/jonschlinkert/minimist-plugins","forks_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/forks","keys_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/teams","hooks_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/hooks","issue_events_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/events","assignees_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/tags","blobs_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/languages","stargazers_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/stargazers","contributors_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/contributors","subscribers_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/subscribers","subscription_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/subscription","commits_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/merges","archive_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/downloads","issues_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/labels{/name}","releases_url":"https://api.github.com/repos/jonschlinkert/minimist-plugins/releases{/id}","created_at":"2015-08-05T03:13:48Z","updated_at":"2015-08-07T12:59:36Z","pushed_at":"2015-08-17T12:16:01Z","git_url":"git://github.com/jonschlinkert/minimist-plugins.git","ssh_url":"git@github.com:jonschlinkert/minimist-plugins.git","clone_url":"https://github.com/jonschlinkert/minimist-plugins.git","svn_url":"https://github.com/jonschlinkert/minimist-plugins","homepage":null,"size":130,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jonschlinkert/minimist-plugins/pulls/4"},"html":{"href":"https://github.com/jonschlinkert/minimist-plugins/pull/4"},"issue":{"href":"https://api.github.com/repos/jonschlinkert/minimist-plugins/issues/4"},"comments":{"href":"https://api.github.com/repos/jonschlinkert/minimist-plugins/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/jonschlinkert/minimist-plugins/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/jonschlinkert/minimist-plugins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jonschlinkert/minimist-plugins/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/jonschlinkert/minimist-plugins/statuses/60d97b393f2fdc2a059836c9919bfc7d02288112"}}}}