diff options
Diffstat (limited to 'humanTable.go')
| -rw-r--r-- | humanTable.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/humanTable.go b/humanTable.go index ecd114a..99fec97 100644 --- a/humanTable.go +++ b/humanTable.go @@ -6,6 +6,7 @@ import ( "fmt" "path/filepath" + "go.wit.com/lib/cobol" "go.wit.com/lib/gui/shell" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" @@ -321,3 +322,35 @@ func (f *Forge) printForgedToTable(repo *gitpb.Repo, sizes []int) { log.Info(start, end) } + +func (psets *Patchsets) PrintTable() { + if psets == nil { + return + } + log.DaemonMode(true) + + // print the header + args := []string{"commit hash", "what", "age", "cId", "partId", "", "", "", "", ""} + sizes := []int{36, 3, 3, 40, 80, 2, 2, 2, 2, 2} + log.Info(cobol.StandardTableSize10(sizes, args)) + + var countCONTENTS int + var countPARTS int + for x, pset := range psets.GetPatchsets() { + log.Info(pset.Uuid, pset.Name) + cId := log.Sprintf("%d", x) + countCONTENTS += 1 + for i, p := range pset.Patches.GetPatches() { + var args []string + partId := log.Sprintf("%d", i) + + _, fname := filepath.Split(p.GetFilename()) + args = []string{p.CommitHash, cId, partId, fname, p.GetNamespace(), "", "", "", "", ""} + + start := cobol.StandardTableSize10(sizes, args) + log.Info(start) + countPARTS += 1 + } + } + log.Infof("Total Contents (%d) Parts (%d)\n", countCONTENTS, countPARTS) +} |
