diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2014-11-27 17:36:31 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2014-11-27 17:36:31 +0300 |
commit | dabe97889114ab6918c6afb77ebf33d6c492e5b7 (patch) | |
tree | 6f76603bbd4dc5d6f7186061692f9b40f46d35ab /bin | |
parent | 686c87d3b2bb8c72024991bdca5ffe1a3ffe5361 (diff) |
Report file size when running with --list switch
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/cmd.js | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -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) +} |