diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-08-02 21:11:18 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-08-02 21:11:18 +0200 |
commit | b92c8aa4bccd23eacd1a2921dd2535ea1928bdf3 (patch) | |
tree | e8bb1cd4cb71c3985882ca87a372831f0118b224 /bin | |
parent | 0d5828e2069c51260677df1cc9e24e64a162acd6 (diff) |
bin/pkg: progress: Buffer output for less flickering with ssh
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pkg | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -127,22 +127,21 @@ progress () { max=$2 desc=$3 desc2=$4 + output='' currentper=$[$[$current*100]/$max] - say () { - [[ $SILENT = 1 ]] || echo -ne $* - } item () { for j in {0..$1}; { - [[ $j -gt 0 ]] && say $2 + [[ $j -gt 0 ]] && output+=$2 } } clear_line c=$[$currentper/5] a=$[20-$c] - say "${info}$desc${reset} [" + output+="${info}$desc${reset} [" item $c '=' item $a ' ' - say "] $currentper% $desc2" + output+="] $currentper% $desc2" + [[ $SILENT = 1 ]] || echo -ne $output } ## VCS Wrappers |