Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2014-11-27 17:36:31 +0300
committerFeross Aboukhadijeh <feross@feross.org>2014-11-27 17:36:31 +0300
commitdabe97889114ab6918c6afb77ebf33d6c492e5b7 (patch)
tree6f76603bbd4dc5d6f7186061692f9b40f46d35ab /bin
parent686c87d3b2bb8c72024991bdca5ffe1a3ffe5361 (diff)
Report file size when running with --list switch
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmd.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index 7b336db..b1bd92a 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -195,7 +195,7 @@ function onReady () {
if (argv.list) {
torrent.files.forEach(function (file, i) {
- clivas.line('{3+bold:' + i + '} : {magenta:' + file.name + '}')
+ clivas.line('{3+bold:'+i+'} : {magenta:'+file.name+'} {blue:('+bytes(file.length)+')}')
})
return done()
}
@@ -215,7 +215,11 @@ function onReady () {
var numActiveWires = torrent.swarm.wires.reduce(function (num, wire) {
return num + (wire.downloaded > 0)
}, 0)
- clivas.line('torrent downloaded {green:successfully} from {bold:'+numActiveWires+'/'+torrent.swarm.wires.length+'} {green:peers} in {bold:'+getRuntime()+'s}!')
+ clivas.line(
+ 'torrent downloaded {green:successfully} from ' +
+ '{bold:'+numActiveWires+'/'+torrent.swarm.wires.length+'} {green:peers} ' +
+ 'in {bold:'+getRuntime()+'s}!'
+ )
}
done()
})
@@ -328,10 +332,6 @@ function onReady () {
return !wire.peerChoking
}
- function bytes (num) {
- return prettysize(num)
- }
-
function draw () {
var unchoked = wires.filter(active)
var linesremaining = clivas.height
@@ -422,3 +422,7 @@ function onReady () {
clivas.flush(true)
}
}
+
+function bytes (num) {
+ return prettysize(num)
+}