node-helmsman
node-helmsman copied to clipboard
`command help --help` doesn't work
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!
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?
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.
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.