summaryrefslogtreecommitdiff
path: root/cobol.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-18 22:02:07 -0600
committerJeff Carr <[email protected]>2024-12-18 22:02:07 -0600
commit9adb650b3ed1a64a5207da04fe3c7e80b10cddd6 (patch)
tree7a042622e7288c77e50d966b26a36ecf1406fa21 /cobol.go
parente30ef08c119ed4e539d3aac74c9d6010a95c9423 (diff)
add --dirtyv0.22.25
Diffstat (limited to 'cobol.go')
-rw-r--r--cobol.go23
1 files changed, 16 insertions, 7 deletions
diff --git a/cobol.go b/cobol.go
index 793075e..f2bcfaa 100644
--- a/cobol.go
+++ b/cobol.go
@@ -3,6 +3,7 @@ package main
import (
"fmt"
+ "go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
)
@@ -33,7 +34,7 @@ func doCobol() {
log.DaemonMode(true)
// log.Info(standardStart5("gopath", "cur name", "master", "user", "repo type"))
- log.Info(standardStart8("gopath", "cur name", "target", "master", "devel", "user", "curver", "repo type"))
+ log.Info(standardStart8("gopath", "cur name", "age", "target", "master", "devel", "user", "curver", "repo type"))
all := me.found.SortByFullPath()
for all.Scan() {
repo := all.Next()
@@ -71,15 +72,16 @@ func standardStart5(arg1, arg2, arg3, arg4, arg5 string) string {
return fmt.Sprintf(s, arg1, arg2, arg3, arg4, arg5)
}
-func standardStart8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 string) string {
+func standardStart8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 string) string {
len1 := 40
len2 := 12
- len3 := 16
+ len3 := 6
len4 := 16
len5 := 16
len6 := 16
len7 := 16
- len8 := 8
+ len8 := 16
+ len9 := 8
var s string
if len(arg1) > len1 {
arg1 = arg1[:len1]
@@ -118,12 +120,17 @@ func standardStart8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 string) strin
}
s += "%-" + fmt.Sprintf("%d", len8) + "s"
- return fmt.Sprintf(s, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
+ if len(arg9) > len9 {
+ arg9 = arg9[:len9]
+ }
+ s += "%-" + fmt.Sprintf("%d", len9) + "s"
+
+ return fmt.Sprintf(s, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
}
func verifyPrint(repo *gitpb.Repo) {
var end string
- if repo.CheckDirty() {
+ if repo.IsDirty() {
end += "(dirty) "
}
s := make(map[string]string)
@@ -144,8 +151,10 @@ func verifyPrint(repo *gitpb.Repo) {
var chort string = s["cver"] // current version
var cname string = s["cname"] // current branch name git is on now
+ age := shell.FormatDuration(repo.NewestAge())
+
// start := fmt.Sprintf("%-40s %-12s %-12s %-12s %-8s", s["gopath"], cname, mhort, uhort, s["rtype"])
- start := standardStart8(s["gopath"], cname, thort, mhort, dhort, uhort, chort, s["rtype"])
+ start := standardStart8(s["gopath"], cname, age, thort, mhort, dhort, uhort, chort, s["rtype"])
if me.forge.Config.IsReadOnly(repo.GetGoPath()) {
end += "(readonly) "