{"action":"created","issue":{"url":"https://api.github.com/repos/tj/commander.js/issues/248","labels_url":"https://api.github.com/repos/tj/commander.js/issues/248/labels{/name}","comments_url":"https://api.github.com/repos/tj/commander.js/issues/248/comments","events_url":"https://api.github.com/repos/tj/commander.js/issues/248/events","html_url":"https://github.com/tj/commander.js/issues/248","id":41729441,"number":248,"title":"Using 'filter' (or other native array methods) as a command causing error","user":{"login":"jonathandelgado","id":1841149,"avatar_url":"https://avatars.githubusercontent.com/u/1841149?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathandelgado","html_url":"https://github.com/jonathandelgado","followers_url":"https://api.github.com/users/jonathandelgado/followers","following_url":"https://api.github.com/users/jonathandelgado/following{/other_user}","gists_url":"https://api.github.com/users/jonathandelgado/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathandelgado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathandelgado/subscriptions","organizations_url":"https://api.github.com/users/jonathandelgado/orgs","repos_url":"https://api.github.com/users/jonathandelgado/repos","events_url":"https://api.github.com/users/jonathandelgado/events{/privacy}","received_events_url":"https://api.github.com/users/jonathandelgado/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tj/commander.js/labels/Backlog","name":"Backlog","color":"CCCCCC"},{"url":"https://api.github.com/repos/tj/commander.js/labels/bug","name":"bug","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-09-02T16:40:35Z","updated_at":"2015-03-17T06:42:51Z","closed_at":"2014-09-03T00:09:34Z","body":"Came across an error today when using `filter` as a command input.\r\n\r\nSimple reproduction:\r\n```\r\ncom.command('seed <tpl>')\r\n\t.action(function(tpl){});\r\n```\r\nJust running the command `<script> seed filter` will cause a module not found error, no special coding required.\r\n\r\n```\r\nError: Cannot find module 'c:\\Users\\...\\bin\\cmd-filter'\r\n    at Function.Module._resolveFilename (module.js:338:15)\r\n    at Function.Module._load (module.js:280:25)\r\n    at Function.Module.runMain (module.js:497:10)\r\n    at startup (node.js:119:16)\r\n    at node.js:906:3\r\n```\r\n\r\nIt is caused by line 380 of commander's `index.js` - Even if the `this._execs` array is empty, calling `this._execs['filter']` will return the native function, thus causing the argument to be true and creating this error.\r\n\r\nBest solution in my opinion is double checking the value to make sure it is not a function. If you would like, I can throw in a PR.\r\n\r\nThank you for your time."},"comment":{"url":"https://api.github.com/repos/tj/commander.js/issues/comments/82154168","html_url":"https://github.com/tj/commander.js/issues/248#issuecomment-82154168","issue_url":"https://api.github.com/repos/tj/commander.js/issues/248","id":82154168,"user":{"login":"startswithaj","id":3658522,"avatar_url":"https://avatars.githubusercontent.com/u/3658522?v=3","gravatar_id":"","url":"https://api.github.com/users/startswithaj","html_url":"https://github.com/startswithaj","followers_url":"https://api.github.com/users/startswithaj/followers","following_url":"https://api.github.com/users/startswithaj/following{/other_user}","gists_url":"https://api.github.com/users/startswithaj/gists{/gist_id}","starred_url":"https://api.github.com/users/startswithaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/startswithaj/subscriptions","organizations_url":"https://api.github.com/users/startswithaj/orgs","repos_url":"https://api.github.com/users/startswithaj/repos","events_url":"https://api.github.com/users/startswithaj/events{/privacy}","received_events_url":"https://api.github.com/users/startswithaj/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T06:42:51Z","updated_at":"2015-03-17T06:42:51Z","body":"Resolves https://github.com/tj/commander.js/issues/206"}}