Comparing version 0.6.5 to 0.6.6
24
cli.js
@@ -67,3 +67,3 @@ /** | ||
cli.output = cli.native.util.print; | ||
cli.output = console.log; | ||
cli.exit = require('exit'); | ||
@@ -1097,3 +1097,4 @@ | ||
var last_progress_call, progress_len = 74; | ||
cli.progress = function (progress, decimals) { | ||
cli.progress = function (progress, decimals, stream) { | ||
stream = stream || process.stdout; | ||
if (progress < 0 || progress > 1 || isNaN(progress)) return; | ||
@@ -1121,3 +1122,9 @@ if (!decimals) decimals = 0; | ||
} | ||
cli.native.util.print('[' + str + '] ' + percentage + (progress === 1 ? '\n' : '\u000D')); | ||
stream.clearLine(); | ||
stream.write('[' + str + '] ' + percentage); | ||
if (progress === 1) { | ||
stream.write('\n'); | ||
} else { | ||
stream.cursorTo(0); | ||
} | ||
}; | ||
@@ -1132,5 +1139,8 @@ | ||
var spinnerInterval; | ||
cli.spinner = function (prefix, end) { | ||
cli.spinner = function (prefix, end, stream) { | ||
stream = stream || process.stdout; | ||
if (end) { | ||
cli.native.util.print('\u000D' + prefix); | ||
stream.clearLine(); | ||
stream.cursorTo(0); | ||
stream.write(prefix + '\n'); | ||
return clearInterval(spinnerInterval); | ||
@@ -1141,5 +1151,7 @@ } | ||
spinnerInterval = setInterval(function () { | ||
cli.native.util.print('\u000D' + prefix + spinner[i++]); | ||
stream.clearLine(); | ||
stream.cursorTo(0); | ||
stream.write(prefix + spinner[i++]); | ||
if (i == l) i = 0; | ||
}, 200); | ||
}; |
{ "name" : "cli", | ||
"description" : "A tool for rapidly building command line apps", | ||
"version" : "0.6.5", | ||
"version" : "0.6.6", | ||
"homepage" : "http://github.com/chriso/cli", | ||
@@ -5,0 +5,0 @@ "keywords" : ["cli","command line","opts","parseopt","opt","args","console","argsparse","optparse","daemon","autocomplete","command","autocompletion"], |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50508
16
1234