forgepb/human.go

27 lines
661 B
Go
Raw Normal View History

2024-11-20 12:11:13 -06:00
package forgepb
import "fmt"
2024-11-20 12:11:13 -06:00
// mostly just functions related to making STDOUT
// more readable by us humans
// also function shortcuts the do fixed limited formatting (it's like COBOL)
// so reporting tables of the status of what droplets and hypervisors
// are in text columns and rows that can be easily read in a terminal
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)
}