diff --git a/cli.js b/cli.js index 4737255..4ae8b5c 100644 --- a/cli.js +++ b/cli.js @@ -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); @@ -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; }; diff --git a/package.json b/package.json index f31cbcf..1761875 100755 --- a/package.json +++ b/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 ",