summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--forgeConfig/main.go3
-rw-r--r--human.go14
-rw-r--r--readonly.go (renamed from update.go)0
3 files changed, 15 insertions, 2 deletions
diff --git a/forgeConfig/main.go b/forgeConfig/main.go
index cd07016..e874304 100644
--- a/forgeConfig/main.go
+++ b/forgeConfig/main.go
@@ -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)
diff --git a/human.go b/human.go
index 479c6d6..322e6c2 100644
--- a/human.go
+++ b/human.go
@@ -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)
+}
diff --git a/update.go b/readonly.go
index 27e23ee..27e23ee 100644
--- a/update.go
+++ b/readonly.go