{"action":"closed","issue":{"url":"https://api.github.com/repos/tj/commander.js/issues/414","labels_url":"https://api.github.com/repos/tj/commander.js/issues/414/labels{/name}","comments_url":"https://api.github.com/repos/tj/commander.js/issues/414/comments","events_url":"https://api.github.com/repos/tj/commander.js/issues/414/events","html_url":"https://github.com/tj/commander.js/issues/414","id":89810769,"number":414,"title":"Bug: mysterious \"undefined\" in the help text","user":{"login":"inadarei","id":30158,"avatar_url":"https://avatars.githubusercontent.com/u/30158?v=3","gravatar_id":"","url":"https://api.github.com/users/inadarei","html_url":"https://github.com/inadarei","followers_url":"https://api.github.com/users/inadarei/followers","following_url":"https://api.github.com/users/inadarei/following{/other_user}","gists_url":"https://api.github.com/users/inadarei/gists{/gist_id}","starred_url":"https://api.github.com/users/inadarei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inadarei/subscriptions","organizations_url":"https://api.github.com/users/inadarei/orgs","repos_url":"https://api.github.com/users/inadarei/repos","events_url":"https://api.github.com/users/inadarei/events{/privacy}","received_events_url":"https://api.github.com/users/inadarei/received_events","type":"User","site_admin":false},"labels":[{"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":"2015-06-20T19:56:10Z","updated_at":"2015-10-11T03:48:24Z","closed_at":"2015-10-11T03:48:24Z","body":"If you execute, following code used as the sample in Commander's documentation:\r\n\r\n```javascript\r\n#!/usr/bin/env node\r\n\r\nvar program = require('commander');\r\n\r\nprogram\r\n  .version('0.0.1')\r\n  .command('rmdir <dir> [otherDirs...]')\r\n  .action(function (dir, otherDirs) {\r\n    console.log('rmdir %s', dir);\r\n    if (otherDirs) {\r\n      otherDirs.forEach(function (oDir) {\r\n        console.log('rmdir %s', oDir);\r\n      });\r\n    }\r\n  });\r\n  \r\nprogram.parse(process.argv);  \r\n```\r\n\r\nYou will get mysterious \"undefined\" in the auto-generated help:\r\n\r\n```console\r\n./commandertest -h\r\n\r\n  Usage: commandertest [options] [command]\r\n\r\n\r\n  Commands:\r\n\r\n    rmdir <dir> [otherDirs...]  undefined\r\n\r\n  Options:\r\n\r\n    -h, --help     output usage information\r\n    -V, --version  output the version number\r\n```\r\n"}}