diff options
| -rw-r--r-- | tableDefault.go | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/tableDefault.go b/tableDefault.go index eb6d135..c44aa41 100644 --- a/tableDefault.go +++ b/tableDefault.go @@ -40,6 +40,19 @@ func (f *Forge) PrintDefaultTB(pb *gitpb.Repos) string { return log.Sprintf("f.DefaultRepos: total=(%d) dirty=(%d) writable=(%d) binaries=(%d) protobufs(%d)", pb.Len(), dirty, writable, bins, protos) } +func (f *Forge) NormalCheckTB(pb *gitpb.Repos) string { + var col *gitpb.RepoFunc + t := f.makeDefaultBaseTB(pb) + + col = t.AddState() + col.Width = 16 + col = t.AddStateChange() + col.Width = -1 + + t.PrintTable() + return log.Sprintf("f.NormalCheck: total=(%d)", pb.Len()) +} + func (f *Forge) getRepoType(repo *gitpb.Repo) string { var rtype string = repo.GetRepoType() switch rtype { @@ -57,6 +70,31 @@ func (f *Forge) getRepoType(repo *gitpb.Repo) string { } func (f *Forge) makeDefaultTB(pb *gitpb.Repos) *gitpb.ReposTable { + t := f.makeDefaultBaseTB(pb) + var col *gitpb.RepoFunc + + col = t.AddStringFunc("type", func(r *gitpb.Repo) string { + return f.getRepoType(r) + }) + col.Width = 6 + + col = t.AddStringFunc("r/w", func(r *gitpb.Repo) string { + if f.IsWritable(r) { + return "rw" + } + return "" + }) + col.Width = 3 + + col = t.AddState() + col.Width = 12 + + col = t.AddURL() + col.Width = -1 + return t +} + +func (f *Forge) makeDefaultBaseTB(pb *gitpb.Repos) *gitpb.ReposTable { t := pb.NewTable("forgedList") t.NewUuid() @@ -96,23 +134,5 @@ func (f *Forge) makeDefaultTB(pb *gitpb.Repos) *gitpb.ReposTable { col.Width = 12 col.Header.Name = "master" - col = t.AddStringFunc("type", func(r *gitpb.Repo) string { - return f.getRepoType(r) - }) - col.Width = 6 - - col = t.AddStringFunc("r/w", func(r *gitpb.Repo) string { - if f.IsWritable(r) { - return "rw" - } - return "" - }) - col.Width = 3 - - col = t.AddState() - col.Width = 12 - - col = t.AddURL() - col.Width = -1 return t } |
