From: Timo Kokkonen Date: Fri, 24 Jun 2011 15:55:34 +0000 (+0300) Subject: main: Print how many entries we have read from the meter X-Git-Url: http://git.itanic.dy.fi/?p=glucose;a=commitdiff_plain;h=7d220f098d98298450482d397bea089dc2a474b8 main: Print how many entries we have read from the meter This makes it easier for an inpatient user to wait until all the readings have been taken out from the device. Signed-off-by: Timo Kokkonen --- diff --git a/main.c b/main.c index 888c339..6e87602 100644 --- a/main.c +++ b/main.c @@ -19,6 +19,7 @@ int main(int argc, char *argv[]) struct user_options opts; struct msg msg; int fd, usage_code, ret, error; + int entries = 0; read_args(argc, argv, &opts); @@ -56,7 +57,14 @@ int main(int argc, char *argv[]) break; fprintf(outf, "%s\n", msg.data); + + entries++; + if (outf != stdout) { + trace(0, "\r%d", entries); + fflush(stdout); + } } + trace(0, "\n"); return 0; }