diff options
author | Soumith Chintala <soumith@gmail.com> | 2016-02-27 19:22:17 +0300 |
---|---|---|
committer | Soumith Chintala <soumith@gmail.com> | 2016-02-27 19:22:17 +0300 |
commit | 98c11caac263e21f793ab2e6a8ed536b3c7cb135 (patch) | |
tree | 418bbad508e53b263a882460de5499587fdf19ac | |
parent | ab8ffadd0df03ebdacb6abc2c049216310217e1a (diff) | |
parent | 87ae1f554b85c661ddae32a79afd514c899eea2c (diff) |
Merge pull request #15 from jnhwkim/patch-1
fix to center align of a progress indicator
-rw-r--r-- | init.lua | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -284,13 +284,14 @@ do end -- Print remaining time when running or total time when done. if (percent < barLength) then - io.write('ETA: ' .. formatTime(remaining)) + tm = ' ETA: ' .. formatTime(remaining) else - io.write('Tot: ' .. formatTime(elapsed)) + tm = ' Tot: ' .. formatTime(elapsed) end - io.write(' | Step: ' .. formatTime(step)) + tm = tm .. ' | Step: ' .. formatTime(step) + io.write(tm) -- go back to center of bar, and print progress - for i=1,6+#tm+barLength/2 do io.write('\b') end + for i=1,5+#tm+barLength/2 do io.write('\b') end io.write(' ', current, '/', goal, ' ') -- reset for next bar if (percent == barLength) then |