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

command help --help doesn't work #12

Open
rrthomas opened this issue Sep 9, 2014 · 3 comments
Open

command help --help doesn't work #12

rrthomas opened this issue Sep 9, 2014 · 3 comments

Comments

@rrthomas
Copy link

rrthomas commented Sep 9, 2014

helmsman gets confused, and tries to run command-help --help, which of course won't typically exist. (Tested with 0.4.0.) Helmsman specifically avoids using the built-in help command in this case, which suggests that this is deliberate behavior, though it doesn't seem very help-ful!

@mattmcmanus
Copy link
Owner

Hey @rrthomas, I'm not quite sure I understand the problem. What command are you typing, what do you expect to happen and what is happening instead?

@rrthomas
Copy link
Author

rrthomas commented Sep 9, 2014

My script:

#!/usr/bin/env node

"use strict";

var path = require('path');
var helmsman = require('helmsman');

var name = path.basename(process.argv[1], '.js');
var cli = helmsman({localDir: './app/commands'});
cli.on('--help', function(){
    console.log('Usage: ' + name + ' [options] [command]');
});
cli.parse();

Call it foo. I run foo help and it gives me help. I run foo --help and it gives me help. I run foo help --help and it crashes. It should just give me the same help.

@mattmcmanus
Copy link
Owner

I see. That is definitely an edge case I hadn't considered. The code is in some need of refactoring so I'll take that into consideration.

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