Reformat progress lines and prune output
Progress lines now use the form: ..., <subject> elapsed: <dur>, <subject> ETA: <time> (est remain <dur>). ui.Time formats same-day times as HH:MM:SS and other-day times as YYYY-MM-DD HH:MM:SS, with no timezone suffix (local time is implied). The local-index-database prune complete line now shows remaining counts for each category: ... 1 incomplete snapshots removed (3 remain), 3783 orphaned files removed (42 remain), ...
This commit is contained in:
@@ -188,9 +188,17 @@ func (w *Writer) Duration(d time.Duration) string {
|
||||
return w.paint(ansiYellow, d.Round(time.Second).String())
|
||||
}
|
||||
|
||||
// Time colorizes an absolute time (RFC3339, second precision).
|
||||
// Time colorizes an absolute clock time. If t falls on today's local
|
||||
// calendar date the output is "HH:MM:SS"; otherwise it is
|
||||
// "YYYY-MM-DD HH:MM:SS". No timezone is included — values are
|
||||
// displayed in the process's local zone.
|
||||
func (w *Writer) Time(t time.Time) string {
|
||||
return w.paint(ansiYellow, t.Format(time.RFC3339))
|
||||
t = t.Local()
|
||||
now := time.Now()
|
||||
if t.Year() == now.Year() && t.YearDay() == now.YearDay() {
|
||||
return w.paint(ansiYellow, t.Format("15:04:05"))
|
||||
}
|
||||
return w.paint(ansiYellow, t.Format("2006-01-02 15:04:05"))
|
||||
}
|
||||
|
||||
// Count colorizes an integer count with thousands separators.
|
||||
|
||||
Reference in New Issue
Block a user