diff options
Diffstat (limited to 'human.go')
| -rw-r--r-- | human.go | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -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)) } } |
