From 245ebc21286aa58a969edbadba14e61c5b5f7761 Mon Sep 17 00:00:00 2001 From: Tim De Pauw Date: Sat, 28 Apr 2018 10:55:29 +0200 Subject: [PATCH] Only print CR if live-updating --- internal/app/lwc/process.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/app/lwc/process.go b/internal/app/lwc/process.go index dbd9829..3cc726c 100644 --- a/internal/app/lwc/process.go +++ b/internal/app/lwc/process.go @@ -65,8 +65,9 @@ func ProcessFile(namePtr *string, processors []Processor, totals *[]uint64, inte } // Update stdout at fixed intervals, but only if it's a terminal + live := lwcutil.StdoutIsTTY() var done chan bool - if lwcutil.StdoutIsTTY() { + if live { done = make(chan bool) // Write zeroes straightaway in case file is empty PrintCounts(&counts, name, false, false) @@ -86,7 +87,7 @@ func ProcessFile(namePtr *string, processors []Processor, totals *[]uint64, inte } // Write final counts - PrintCounts(&counts, name, true, true) + PrintCounts(&counts, name, live, true) } func ProcessFiles(config *Config) {