node-helmsman icon indicating copy to clipboard operation
node-helmsman copied to clipboard

`command help --help` doesn't work

Open rrthomas opened this issue 11 years ago • 3 comments

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!

rrthomas avatar Sep 09 '14 17:09 rrthomas

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?

mattmcmanus avatar Sep 09 '14 17:09 mattmcmanus

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.

rrthomas avatar Sep 09 '14 18:09 rrthomas

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.

mattmcmanus avatar Sep 09 '14 18:09 mattmcmanus