From 7d220f098d98298450482d397bea089dc2a474b8 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Fri, 24 Jun 2011 18:55:34 +0300 Subject: [PATCH] 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 --- main.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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; } -- 2.44.0