Skip to content

Commit

Permalink
Fix some minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Jul 4, 2011
1 parent f08a713 commit e1aa65a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cli.js
Expand Up @@ -633,7 +633,7 @@ cli.getUsage = function () {
line = pad(line, switch_pad);
line += trunc_desc(line, desc);
line += optional ? ' (Default is ' + optional + ')' : '';
console.error(line);
console.error(line.replace('%s', '%\0s'));

seen_opts.push(short);
seen_opts.push(long);
Expand Down Expand Up @@ -741,7 +741,7 @@ cli.getValue = function (default_val, validate_func, err_msg) {
if (value) {
argv.unshift(value);
}
return default_val || cli.fatal(err_msg);
return default_val != null ? default_val : cli.fatal(err_msg);
}
return value;
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{ "name" : "cli",
"description" : "A tool for rapidly building command line apps",
"version" : "0.3.6",
"version" : "0.3.7",
"homepage" : "http://github.com/chriso/cli",
"keywords" : ["cli","command line","opts","parseopt","opt","args","console","argsparse","optparse","daemon","autocomplete","command","autocompletion"],
"author" : "Chris O'Hara <cohara87@gmail.com>",
Expand Down

0 comments on commit e1aa65a

Please sign in to comment.