improved bundle cli output with progress

This commit is contained in:
Joe Lothan 2026-05-20 09:46:59 -04:00
parent 86cff37533
commit 3bc355e503

View file

@ -228,13 +228,16 @@ func main() {
log.Fatalf("Failed to write bundle %d: %v", job.index, err)
}
n := bundlesCreated.Add(1)
estimatedTotal := (totalHosts + cfg.EntriesPerBundle - 1) / cfg.EntriesPerBundle
if n%500 == 0 {
fmt.Printf(" %d/%d bundles\n", n, estimatedTotal)
}
logLine := fmt.Sprintf("bundle: %04d.json %dKB", job.index, len(job.data)/1024)
fmt.Println(logLine)
if logWriter != nil {
logWriter.Write(logLine, false)
}
bundlesCreated.Add(1)
totalBytes.Add(int64(len(job.data)))
}
}()