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

Specifying command description forces lookup of command in separate file #715

Closed
maximilianschmitt opened this issue Nov 15, 2017 · 1 comment

Comments

@maximilianschmitt
Copy link

maximilianschmitt commented Nov 15, 2017

Commander 2.11.0
Node 6.11.0

Simple test case:

'use strict'

const app = require('commander')

app
  .command("command-name", "asdasd") // <-- Note the added description
  .action(function() {
    console.log("Executing command-name");
  });

app.parse(process.argv)

Output (exit code 1):

$ node app.js command-name
Executing command-name

  app-command-name(1) does not exist, try --help

Expected output (exit code 0):

$ node app.js command-name
Executing command-name

Removing the description in .command() yields the expected results:

'use strict'

const app = require('commander')

app
  .command("command-name")  // <-- Note the missing description
  .action(function() {
    console.log("Executing command-name");
  });

app.parse(process.argv)
@shadowspawn
Copy link
Collaborator

I agree, we should improve the documentation and the runtime behaviour to make this clearer. I have referenced this issue as one of a number of related issues.

This issue has not had any activity in over six months. It isn't likely to get acted on due to this report.

Feel free to open a new issue if it comes up again, with new information and renewed interest.

Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants