diff --git a/humanTable.go b/humanTable.go index 6272823..b2311d5 100644 --- a/humanTable.go +++ b/humanTable.go @@ -40,7 +40,7 @@ func (f *Forge) PrintHumanTable(allr *gitpb.Repos) { var count int // log.Info(standardStart5("gopath", "cur name", "master", "user", "repo type")) - log.Info(standardTable8("repopath", "cur br", "age", "master", "devel", "user", "curver", "next", "repo type")) + log.Info(standardTable10("repopath", "cur br", "age", "master", "devel", "user", "curver", "lasttag", "next", "repo type")) all := allr.SortByFullPath() for all.Scan() { repo := all.Next() @@ -56,7 +56,7 @@ func (f *Forge) PrintHumanTableDirty(allr *gitpb.Repos) { var count int // log.Info(standardStart5("gopath", "cur name", "master", "user", "repo type")) - log.Info(standardTable8("repopath", "cur br", "age", "master", "devel", "user", "curver", "next", "repo type")) + log.Info(standardTable10("repopath", "cur br", "age", "master", "devel", "user", "curver", "lasttag", "next", "repo type")) // all := allr.SortByFullPath() all := allr.All() for all.Scan() { @@ -105,7 +105,7 @@ func standardTable5(arg1, arg2, arg3, arg4, arg5 string) string { return fmt.Sprintf(s, arg1, arg2, arg3, arg4, arg5) } -func standardTable8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 string) string { +func standardTable10(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10 string) string { len1 := 40 len2 := 12 len3 := 6 @@ -114,7 +114,8 @@ func standardTable8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 string) len6 := 16 len7 := 16 len8 := 12 - len9 := 8 + len9 := 12 + len10 := 8 var s string if len(arg1) > len1 { arg1 = arg1[:len1] @@ -158,7 +159,12 @@ func standardTable8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 string) } s += "%-" + fmt.Sprintf("%d", len9) + "s " - return fmt.Sprintf(s, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) + if len(arg10) > len10 { + arg10 = arg10[:len10] + } + s += "%-" + fmt.Sprintf("%d", len10) + "s " + + return fmt.Sprintf(s, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) } func (f *Forge) printRepoToTable(repo *gitpb.Repo) { @@ -172,6 +178,7 @@ func (f *Forge) printRepoToTable(repo *gitpb.Repo) { // blank these out uhort = "" } + var lasttag string = repo.GetLastTag() var thort string = repo.GetTargetVersion() var chort string = repo.GetCurrentBranchVersion() var cname string = repo.GetCurrentBranchName() @@ -194,7 +201,7 @@ func (f *Forge) printRepoToTable(repo *gitpb.Repo) { end += "(dirty) " } - start := standardTable8(gopath, cname, age, mhort, dhort, uhort, chort, thort, rtype) + start := standardTable10(gopath, cname, age, mhort, dhort, uhort, chort, lasttag, thort, rtype) if rtype == "protobuf" { if repo.GoInfo.GoBinary {