summaryrefslogtreecommitdiff
path: root/humanTable.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-15 18:18:30 -0600
committerJeff Carr <[email protected]>2025-02-15 18:18:30 -0600
commit22ebf174c81d7b2c45d283751392d58d7e41c6c4 (patch)
tree8acf1617fd714aedef1dfc66bdc8fcc70e2dfb40 /humanTable.go
parent9a87c93bad7f3bc26586ef391ce90213742c8138 (diff)
show the lasttagv0.0.81
Diffstat (limited to 'humanTable.go')
-rw-r--r--humanTable.go19
1 files changed, 13 insertions, 6 deletions
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 {