Skip to content

Commit

Permalink
clearing before printing
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Sergot committed Apr 26, 2012
1 parent 3f80105 commit 998bcc3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Term/ProgressBar.pm
Expand Up @@ -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;

Expand Down

0 comments on commit 998bcc3

Please sign in to comment.