summaryrefslogtreecommitdiff
path: root/human.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-04 06:15:45 -0600
committerJeff Carr <[email protected]>2024-11-04 06:15:45 -0600
commitedfdb48ddf85eb414a1a264f724a30eb8bef91d3 (patch)
treeebbe376c19cf260a242cd247c5701a924f2ee969 /human.go
parent98926bf2f80a25e51429d74182254da1103bdbc7 (diff)
sort repos by name
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'human.go')
-rw-r--r--human.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/human.go b/human.go
new file mode 100644
index 0000000..0c22ae8
--- /dev/null
+++ b/human.go
@@ -0,0 +1,25 @@
+package repolist
+
+// make human readable output
+
+import (
+ "fmt"
+ "time"
+
+ "go.wit.com/lib/gui/shell"
+)
+
+// makes a human readable thing for standard out.
+func (r *RepoRow) StandardHeader() string {
+ lastTag := r.LastTag()
+ tag := r.Status.NewestTag()
+ gitAge, _ := tag.GetDate()
+ dur := time.Since(gitAge)
+
+ master := r.Status.GetMasterVersion()
+ devel := r.Status.GetDevelVersion()
+ user := r.Status.GetUserVersion()
+
+ header := fmt.Sprintf("%-35s %5s %-10s %-10s %-10s %-10s %-15s", r.Name(), shell.FormatDuration(dur), lastTag, master, devel, user, r.State())
+ return header
+}