Permalink
Browse files

Merge pull request #26 from kosmotaur/fixxes

fix wrong check for command list
  • Loading branch information...
2 parents e1aa65a + 99ebc5a commit c4cddeb896e0c7289f12b4865bc5bb0b829b5846 @chriso chriso committed Sep 19, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 cli.js
View
4 cli.js
@@ -270,7 +270,7 @@ cli.parse = function (opts, command_def) {
if (!(opt_list[opt] instanceof Array)) {
continue;
}
- if (opt_list[opt][0] === false) {
+ if (!opt_list[opt][0]) {
opt_list[opt][0] = opt;
}
if (o === opt || o === opt_list[opt][0]) {
@@ -586,7 +586,7 @@ cli.getUsage = function () {
return truncated;
};
- usage = usage || cli.app + ' [OPTIONS]' + (command_list ? ' <command>' : '') + ' [ARGS]';
+ usage = usage || cli.app + ' [OPTIONS]' + (command_list.length ? ' <command>' : '') + ' [ARGS]';
console.error('\x1b[1mUsage\x1b[0m:\n ' + usage);
console.error('\n\x1b[1mOptions\x1b[0m: ');
for (opt in opt_list) {

0 comments on commit c4cddeb

Please sign in to comment.