diff options
Diffstat (limited to 'human.go')
| -rw-r--r-- | human.go | 64 |
1 files changed, 42 insertions, 22 deletions
@@ -22,28 +22,8 @@ func (r *RepoRow) StandardHeader() string { 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 -} - -// makes a human readable thing for standard out. -func (r *RepoRow) StandardReleaseHeader() string { - lastTag := r.LastTag() - tag := r.Status.NewestTag() - gitAge, _ := tag.GetDate() - dur := time.Since(gitAge) - - master := r.Status.GetMasterVersion() - target := r.Status.GetTargetVersion() - - header := fmt.Sprintf("%-35s %5s %-10s %-10s %-10s %-15s %-15s", - r.Name(), - shell.FormatDuration(dur), - lastTag, - master, - target, - r.GoState(), - r.State()) + header := fmt.Sprintf("%-35s %5s %-20s %-20s %-20s %-20s %-15s", + r.Name(), shell.FormatDuration(dur), lastTag, master, devel, user, r.State()) return header } @@ -56,6 +36,12 @@ func msg(w http.ResponseWriter, s string) { func (v *RepoList) PrintReport(w http.ResponseWriter, readonly string, onlydirty string, perfect string) { var count int + header := fmt.Sprintf("%-35s %5s %-20s %-20s %-20s %-20s %-15s", + "REPO", "AGE", + "LAST", "MASTER", "DEVEL", "USER", + "STATE") + msg(w, header) + loop := v.ReposSortByName() for loop.Scan() { repo := loop.Repo() @@ -93,9 +79,40 @@ func (v *RepoList) PrintReport(w http.ResponseWriter, readonly string, onlydirty msg(w, fmt.Sprintf("EVERYTHING WORKED repo count = %d", count)) } +// makes a human readable thing for standard out. +func (r *RepoRow) StandardReleaseHeader() string { + lastTag := r.LastTag() + tag := r.Status.NewestTag() + gitAge, _ := tag.GetDate() + dur := time.Since(gitAge) + + curname := r.Status.GetCurrentBranchName() + master := r.Status.GetMasterVersion() + user := r.Status.GetUserVersion() + target := r.Status.GetTargetVersion() + + header := fmt.Sprintf("%-35s %5s %-10s %-10s %-10s %-10s %-20s %-15s", + r.Name(), + shell.FormatDuration(dur), + curname, + lastTag, + master, + target, + user, + r.State()) + return header +} + + func (v *RepoList) PrintReleaseReport(w http.ResponseWriter, readonly string, perfect string) { var count int + header := fmt.Sprintf("%-35s %5s %-10s %-10s %-10s %-10s %-20s %-15s", + "REPO", "AGE", "CUR BR", + "LAST", "MASTER", "TARGET", "USER", + "STATE") + msg(w, header) + loop := v.ReposSortByName() for loop.Scan() { repo := loop.Repo() @@ -106,6 +123,9 @@ func (v *RepoList) PrintReleaseReport(w http.ResponseWriter, readonly string, pe if (repo.State() == "PERFECT") && (perfect == "true") { continue } + if repo.Status.IsReleased() { + continue + } count += 1 header := repo.StandardReleaseHeader() msg(w, header) |
