aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/mbf/cache.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-08-08 13:10:18 +0900
committerOphestra <cat@gensokyo.uk>2026-08-08 13:10:18 +0900
commitd236c9eaf79da25529497621d097a9bfac08d4b4 (patch)
treebbfa336d8bb0d49d4793a2bc98fd3a0815d41856 /cmd/mbf/cache.go
parent3c1a6f0793aa5d907eca6e41971fe8fafe19b3aa (diff)
cmd/mbf: improve title format
This is cleaner for long-running daemon processes, and the additional information is more intuitive. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/mbf/cache.go')
-rw-r--r--cmd/mbf/cache.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/mbf/cache.go b/cmd/mbf/cache.go
index 5a4b9672..847d7d4e 100644
--- a/cmd/mbf/cache.go
+++ b/cmd/mbf/cache.go
@@ -136,15 +136,19 @@ func (cache *cache) open() (err error) {
var n, nc uint64
for enter := range notify {
if enter {
- n++
nc++
} else {
nc--
+ n++
}
+ if nc == 0 {
+ writeTitle(cache.msg, prefix[:len(prefix)-1])
+ continue
+ }
writeTitle(cache.msg, prefix+
"("+strconv.FormatUint(nc, 10)+
- " of "+strconv.FormatUint(n, 10)+")")
+ " running, "+strconv.FormatUint(n, 10)+" complete)")
}
}()
}