Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-11-21 10:37:01 -06:00
parent 5633f4204d
commit 3adf07b442
3 changed files with 15 additions and 2 deletions

View File

@ -11,8 +11,7 @@ import (
var VERSION string
func main() {
var repos *forgepb.Repos
repos = new(forgepb.Repos)
var repos forgepb.Repos
if err := repos.ConfigLoad(); err != nil {
log.Warn("forgepb.ConfigLoad() failed", err)
os.Exit(-1)

View File

@ -1,5 +1,7 @@
package forgepb
import "fmt"
// mostly just functions related to making STDOUT
// more readable by us humans
@ -10,3 +12,15 @@ package forgepb
func RepoHeader() string {
return "Name Path"
}
func (all *Repos) StandardHeader() string {
return fmt.Sprintf("%-4s %40s %s", "r/w", "Path", "flags")
}
func (r *Repo) StandardHeader() string {
var flags string
if r.Private {
flags += "(private) "
}
return fmt.Sprintf("%-4s %40s %s", "true", r.GoPath, flags)
}