Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: mysterious "undefined" in the help text #414

Labels
bug Commander is not working as intended

Comments

@inadarei
Copy link

If you execute, following code used as the sample in Commander's documentation:

#!/usr/bin/env node

var program = require('commander');

program
  .version('0.0.1')
  .command('rmdir <dir> [otherDirs...]')
  .action(function (dir, otherDirs) {
    console.log('rmdir %s', dir);
    if (otherDirs) {
      otherDirs.forEach(function (oDir) {
        console.log('rmdir %s', oDir);
      });
    }
  });

program.parse(process.argv);  

You will get mysterious "undefined" in the auto-generated help:

./commandertest -h

  Usage: commandertest [options] [command]


  Commands:

    rmdir <dir> [otherDirs...]  undefined

  Options:

    -h, --help     output usage information
    -V, --version  output the version number
@zhiyelee
Copy link
Collaborator

Yep. Thank you, I will check it later.

@zhiyelee zhiyelee added the bug Commander is not working as intended label Jun 21, 2015
zhiyelee added a commit that referenced this issue Jun 22, 2015
@juanpablocs
Copy link

missing description?

@ls12styler ls12styler mentioned this issue Oct 5, 2015
zhiyelee added a commit that referenced this issue Oct 11, 2015
@inadarei
Copy link
Author

The latest release on npm still shows "undefined". Where was this bug fixed?

@zhiyelee
Copy link
Collaborator

@inadarei Haven't released a new version. Will release later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment