File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -1442,14 +1442,26 @@ handle_sigint(/*@unused@*/ int signo)
14421442static int
14431443progress_cb (progress_t * pgs , /*@unused@*/ void * data )
14441444{
1445+ int barWidth = 70 , pos , i = 0 ;
14451446 static time_t last_flush = 0 ;
14461447 time_t now = time (NULL );
14471448
1448- if (pgs -> remaining != -1 )
1449+ if (pgs -> remaining != -1 ) {
1450+ fprintf (stdout , "[" );
1451+ pos = barWidth * (pgs -> pc_completed );
1452+ for (i = 0 ; i < barWidth ; ++ i ) {
1453+ if (i < pos )
1454+ fprintf (stdout , "=" );
1455+ else if (i == pos )
1456+ fprintf (stdout , ">" );
1457+ else
1458+ fprintf (stdout , " " );
1459+ }
14491460 fprintf (stdout ,
1450- "%3d%%, %s remaining, %.2f MB/sec \r" ,
1461+ "] %3d%%, %s remaining, %.2f MB/sec \r" ,
14511462 pgs -> pc_completed , pgs -> remaining_text ,
14521463 (double )pgs -> curr_bps / (1024.0 * 1024.0 ));
1464+ }
14531465 else
14541466 fprintf (stdout , "%3d%%\r" , pgs -> pc_completed );
14551467
You can’t perform that action at this time.
0 commit comments