repolist/human.go

26 lines
581 B
Go
Raw Normal View History

package repolist
// make human readable output
import (
"fmt"
"time"
"go.wit.com/lib/gui/shell"
)
// makes a human readable thing for standard out.
func (r *RepoRow) StandardHeader() string {
lastTag := r.LastTag()
tag := r.Status.NewestTag()
gitAge, _ := tag.GetDate()
dur := time.Since(gitAge)
master := r.Status.GetMasterVersion()
devel := r.Status.GetDevelVersion()
user := r.Status.GetUserVersion()
header := fmt.Sprintf("%-35s %5s %-10s %-10s %-10s %-10s %-15s", r.Name(), shell.FormatDuration(dur), lastTag, master, devel, user, r.State())
return header
}