summaryrefslogtreecommitdiff
path: root/human.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-28 00:02:27 -0600
committerJeff Carr <[email protected]>2024-11-28 00:02:27 -0600
commit0401b949c6f900891f1eefaba41295d2c2a96b07 (patch)
treeb95a0a23fe444e212ab873f90b2f347303785b56 /human.go
parent54a93cd5ebbaf7ed72704c1af9a8be5b8c71f5bd (diff)
added Init() and a Forge struct
Diffstat (limited to 'human.go')
-rw-r--r--human.go21
1 files changed, 10 insertions, 11 deletions
diff --git a/human.go b/human.go
index 294a789..e870524 100644
--- a/human.go
+++ b/human.go
@@ -2,7 +2,6 @@ package forgepb
import (
"fmt"
- "os"
"go.wit.com/log"
)
@@ -18,16 +17,16 @@ func standardHeader() string {
return fmt.Sprintf("%-4s %-40s %s", "", "Path", "flags")
}
-func (all *ForgeConfigs) standardHeader(r *ForgeConfig) string {
+func (f *Forge) standardHeader(r *ForgeConfig) string {
var flags string
var readonly string
- if all.IsPrivate(r.GoPath) {
+ if f.IsPrivate(r.GoPath) {
flags += "(private) "
}
- if all.IsFavorite(r.GoPath) {
+ if f.IsFavorite(r.GoPath) {
flags += "(favorite) "
}
- if all.IsReadOnly(r.GoPath) {
+ if f.IsReadOnly(r.GoPath) {
readonly = ""
} else {
readonly = "r/w"
@@ -36,15 +35,15 @@ func (all *ForgeConfigs) standardHeader(r *ForgeConfig) string {
}
// print a human readable table to STDOUT
-func (all *ForgeConfigs) PrintTable() {
- if all == nil {
- log.Info("WTF")
- os.Exit(0)
+func (f *Forge) ConfigPrintTable() {
+ if f == nil {
+ log.Info("WTF forge == nil")
+ panic("WTF forge == nil")
}
log.Info(standardHeader())
- loop := all.SortByPath()
+ loop := f.Config.SortByPath()
for loop.Scan() {
r := loop.Next()
- log.Info(all.standardHeader(r))
+ log.Info(f.standardHeader(r))
}
}