Permalink
Browse files

clearing before printing

  • Loading branch information...
1 parent 3f80105 commit 998bcc3d1c0bbb16e0064b4353bfdf070d1bb373 @sergot committed Apr 26, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/Term/ProgressBar.pm
View
5 lib/Term/ProgressBar.pm
@@ -23,11 +23,12 @@ method update(Int $step) {
my $ext = ' ';
$ext ~= $multi*(100/$.width).round(0.1)~"%" if $.p;
- $ext ~= ' '~ (( $start - $!step ) * ( $.count - $step ) ).floor ~ ' s left' if $.t;
+ $ext ~= ' eta '~ (( $start - $!step ) * ( $.count - $step ) ).floor ~ ' s' if $.t;
if $step % ($.count/$.width).floor == 0 {
+ self!clear;
$!as = "$.name "~$.left~($.style x $multi)~(' ' x ($.width - $multi))~$.right~" $ext";
- print $!as, "\r";
+ print $!as;
}
say '' if $step == $.count;

0 comments on commit 998bcc3

Please sign in to comment.