summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2011-04-09 08:16:46 -0500
committerWilliam Pitcock <nenolod@dereferenced.org>2011-04-09 08:16:46 -0500
commit762e0c717bcae8c2d0f46ba4f35232b773ac8419 (patch)
treecdfec1cfbd4c75354ac1c1aaf9e3c393ffa13039 /src
parent2911d0cad2a2aceda8f617754d5290f6f3ae96f4 (diff)
downloadapk-tools-762e0c717bcae8c2d0f46ba4f35232b773ac8419.tar.gz
apk-tools-762e0c717bcae8c2d0f46ba4f35232b773ac8419.tar.bz2
apk-tools-762e0c717bcae8c2d0f46ba4f35232b773ac8419.tar.xz
apk-tools-762e0c717bcae8c2d0f46ba4f35232b773ac8419.zip
state: make the progress bar look nice
Diffstat (limited to 'src')
-rw-r--r--src/state.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/state.c b/src/state.c
index cbc0f25..6de3629 100644
--- a/src/state.c
+++ b/src/state.c
@@ -712,15 +712,15 @@ static void apk_count_change(struct apk_change *change, struct apk_stats *stats)
static void apk_draw_progress(int percent)
{
- const int bar_width = (apk_screen_width - 15);
+ const int bar_width = (apk_screen_width - 7);
int i;
- fputs("\e7-[", stderr);
+ fprintf(stderr, "\e7%3i%% [", percent);
for (i = 0; i < bar_width * percent / 100; i++)
fputc('#', stderr);
for (; i < bar_width; i++)
fputc(' ', stderr);
- fprintf(stderr, "]- %3i%%", percent);
+ fputc(']', stderr);
fflush(stderr);
fputs("\e8\e[0K", stderr);
}