* mu.c: improve indexing output

This commit is contained in:
Dirk-Jan C. Binnema 2009-12-05 16:38:02 +02:00
parent 817ae22169
commit e20424e7ee
1 changed files with 13 additions and 2 deletions

View File

@ -70,9 +70,20 @@ static MuResult
msg_cb (MuIndexStats* stats, void *user_data)
{
char *kars="-\\|/";
char output[100];
static int i = 0;
static int len = 0;
g_print ("%s%c", (!i)?"":"\b", kars[i % 4]);
while (len --> 0)
printf ("\b");
len = snprintf (output, sizeof(output),
"%c mu is indexing your mails; processed: %d; "
"updated/new: %d",
kars[i % 4], stats->_processed, stats->_updated);
g_print ("%s", output);
++i;
return MU_OK;
@ -204,7 +215,7 @@ main (int argc, char *argv[])
config.quiet ? NULL : msg_cb,
NULL,
NULL);
g_print ("\n");
mu_index_destroy (midx);
} else if (cmd == MU_CMD_QUERY) {