diff --git a/cobol.go b/cobol.go index d8adb1d..c1ebf69 100644 --- a/cobol.go +++ b/cobol.go @@ -32,7 +32,8 @@ import ( func doCobol() { log.DaemonMode(true) - log.Info(standardStart5("gopath", "cur name", "master", "user", "repo type")) + // log.Info(standardStart5("gopath", "cur name", "master", "user", "repo type")) + log.Info(standardStart7("gopath", "cur name", "target", "master", "devel", "user", "repo type")) all := me.found.SortByFullPath() for all.Scan() { repo := all.Next() @@ -70,6 +71,49 @@ func standardStart5(arg1, arg2, arg3, arg4, arg5 string) string { return fmt.Sprintf(s, arg1, arg2, arg3, arg4, arg5) } +func standardStart7(arg1, arg2, arg3, arg4, arg5, arg6, arg7 string) string { + len1 := 40 + len2 := 12 + len3 := 16 + len4 := 16 + len5 := 16 + len6 := 16 + len7 := 8 + var s string + if len(arg1) > len1 { + arg1 = arg1[:len1] + } + s = "%-" + fmt.Sprintf("%d", len1) + "s " + if len(arg2) > len2 { + arg2 = arg2[:len2] + } + s += "%-" + fmt.Sprintf("%d", len2) + "s " + if len(arg3) > len3 { + arg3 = arg3[:len3] + } + s += "%-" + fmt.Sprintf("%d", len3) + "s " + if len(arg4) > len4 { + arg4 = arg4[:len4] + } + s += "%-" + fmt.Sprintf("%d", len4) + "s " + + if len(arg5) > len5 { + arg5 = arg5[:len5] + } + s += "%-" + fmt.Sprintf("%d", len5) + "s " + + if len(arg6) > len6 { + arg6 = arg6[:len6] + } + s += "%-" + fmt.Sprintf("%d", len6) + "s " + + if len(arg7) > len7 { + arg7 = arg7[:len7] + } + s += "%-" + fmt.Sprintf("%d", len7) + "s" + return fmt.Sprintf(s, arg1, arg2, arg3, arg4, arg5, arg6, arg7) +} + func verifyPrint(repo *gitpb.Repo) { var end string if repo.CheckDirty() { @@ -87,11 +131,13 @@ func verifyPrint(repo *gitpb.Repo) { } var mhort string = s["mver"] + var dhort string = s["dver"] var uhort string = s["uver"] + var thort string = s["tver"] var cname string = s["cname"] // start := fmt.Sprintf("%-40s %-12s %-12s %-12s %-8s", s["gopath"], cname, mhort, uhort, s["rtype"]) - start := standardStart5(s["gopath"], cname, mhort, uhort, s["rtype"]) + start := standardStart7(s["gopath"], cname, thort, mhort, dhort, uhort, s["rtype"]) if me.forge.Config.IsReadOnly(repo.GetGoPath()) { end += "(readonly) " @@ -137,6 +183,7 @@ func verify(repo *gitpb.Repo, s map[string]string) bool { log.Info("verify() no user branch name", repo.GetGoPath(), repo.GetUserBranchName()) } s["cver"] = repo.GetCurrentBranchVersion() + s["tver"] = repo.GetTargetVersion() s["url"] = repo.URL return true