Permalink
Browse files

Add echoes function to draw progress bar.

  • Loading branch information...
1 parent 5477a2e commit 8b5126ad59ab88cff12dfd074b88617f863265f8 @suksit committed Jun 23, 2009
Showing with 7 additions and 5 deletions.
  1. +7 −5 onemanga
View
@@ -13,9 +13,11 @@ function calc() {
}
function echoes() {
- for i in `eval echo {${3:-1}..$2}`; do
- echo -n "$1"
- done
+ if [[ $2 -gt 0 ]]; then
+ for i in `eval echo {${3:-1}..$2}`; do
+ echo -n "$1"
+ done
+ fi
}
function progressbar() {
@@ -30,8 +32,8 @@ function progressbar() {
echoes " " ${#percent} 3
echo -n "$percent% ["
- if [[ $stack -gt 0 ]]; then echoes "#" $stack; fi
- if [[ $space -gt 0 ]]; then echoes " " $space; fi
+ echoes "#" $stack
+ echoes " " $space
echo "]"
}

0 comments on commit 8b5126a

Please sign in to comment.