{"action":"closed","issue":{"url":"https://api.github.com/repos/tj/commander.js/issues/390","labels_url":"https://api.github.com/repos/tj/commander.js/issues/390/labels{/name}","comments_url":"https://api.github.com/repos/tj/commander.js/issues/390/comments","events_url":"https://api.github.com/repos/tj/commander.js/issues/390/events","html_url":"https://github.com/tj/commander.js/issues/390","id":66911215,"number":390,"title":"Git-style sub-commands; ENOENT: no such file or directory","user":{"login":"gajus","id":973543,"avatar_url":"https://avatars.githubusercontent.com/u/973543?v=3","gravatar_id":"","url":"https://api.github.com/users/gajus","html_url":"https://github.com/gajus","followers_url":"https://api.github.com/users/gajus/followers","following_url":"https://api.github.com/users/gajus/following{/other_user}","gists_url":"https://api.github.com/users/gajus/gists{/gist_id}","starred_url":"https://api.github.com/users/gajus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gajus/subscriptions","organizations_url":"https://api.github.com/users/gajus/orgs","repos_url":"https://api.github.com/users/gajus/repos","events_url":"https://api.github.com/users/gajus/events{/privacy}","received_events_url":"https://api.github.com/users/gajus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-07T15:08:58Z","updated_at":"2015-04-07T17:44:00Z","closed_at":"2015-04-07T17:44:00Z","body":"Sub-commands using dedicated files do not work (resolve to non-existing base executable).\r\n\r\nThis should provide enough debug information:\r\n\r\n```sh\r\n$ node ./src/bin/mirror foobar titles\r\nfs.js:838\r\n  return binding.lstat(pathModule._makeLong(path));\r\n                 ^\r\nError: ENOENT: no such file or directory, lstat '/mirror/src/bin/mirror'\r\n    at Error (native)\r\n    at fs.lstatSync (fs.js:838:18)\r\n    at exports.readlinkSync (/mirror/node_modules/commander/node_modules/graceful-readlink/index.js:5:7)\r\n    at Command.executeSubCommand (/mirror/node_modules/commander/index.js:472:14)\r\n    at Command.parse (/mirror/node_modules/commander/index.js:443:17)\r\n    at Object.<anonymous> (/mirror/src/bin/mirror.js:15:6)\r\n    at Module._compile (module.js:410:26)\r\n    at Object.Module._extensions..js (module.js:428:10)\r\n    at Module.load (module.js:335:32)\r\n    at Function.Module._load (module.js:290:12)\r\n```\r\n\r\nAs expected, `/mirror/src/bin/mirror` does not exist.\r\n\r\n```sh\r\n$ ls '/mirror/src/bin/mirror'\r\nls: /mirror/src/bin/mirror: No such file or directory\r\n```\r\n\r\n`/mirror/src/bin/mirror.js` does exist (though it is not resolved by commander). Even if I specify to use that file, I get error saying that sub-command does not exist.\r\n\r\n```sh\r\n$ ls '/mirror/src/bin/mirror.js'\r\n/mirror/src/bin/mirror.js\r\n$ node ./src/bin/mirror.js foobar titles\r\n\r\n  mirror-foobar(1) does not exist, try --help\r\n\r\n$ cat ./src/bin/mirror\r\ncat: ./src/bin/mirror: No such file or directory\r\n```\r\n\r\n` ./src/bin/mirror.js`\r\n\r\n```js\r\n'use strict';\r\n\r\nlet commander = require('commander'),\r\n    jsonfile = require('jsonfile'),\r\n    version = jsonfile.readFileSync(__dirname + '/../../package.json').version;\r\n\r\ncommander\r\n    .version(version)\r\n    .command('foobar', 'FOO BAR.')\r\n    .parse(process.argv);\r\n\r\nif (!commander.args.length) {\r\n    commander.outputHelp();\r\n}\r\n```"}}