Commit 4cfe0c4c82
4cfe0c4c8240070689e977c03b07795cb6cf8fbb
parent: 0e343a88e5
Verified · cmc
cmc <hello@cleberg.net> · 2026-09-12 06:00 UTC
control: status list and repo topics print rows
Ref #183
internal/control/repo.go
+5 −3
| @@ -141,7 +141,7 @@ func validQuery(q string) error { |
| 141 | 141 | // stay available so an archived repo can be managed and unarchived. |
| 142 | 142 | func refuseArchived(c *Ctx, repo store.Repo) int { |
| 143 | 143 | if repo.Settings.Archived { |
| 144 | | return c.fail(protocol.ExitDenied, "%s is archived and read-only", repo.Path()) |
| 144 | return c.fail(protocol.ExitDenied, "%s is archived and read-only; unarchive it first", repo.Path()) |
| 145 | 145 | } |
| 146 | 146 | return -1 |
| 147 | 147 | } |
| @@ -165,7 +165,7 @@ func resolveRepo(c *Ctx, path string, check func(store.User, store.Repo, string) |
| 165 | 165 | // Invisible repos 404, per the enumeration rule. |
| 166 | 166 | return repo, c.fail(protocol.ExitNotFound, "repository %s not found", path) |
| 167 | 167 | } |
| 168 | | return repo, c.fail(protocol.ExitDenied, "permission denied on %s", path) |
| 168 | return repo, c.fail(protocol.ExitDenied, "permission denied on %s; ask its owner for access", path) |
| 169 | 169 | } |
| 170 | 170 | return repo, -1 |
| 171 | 171 | } |
| @@ -846,7 +846,9 @@ func editTopics(c *Ctx, args []string, add bool) int { |
| 846 | 846 | return c.fail(protocol.ExitFailure, "%v", err) |
| 847 | 847 | } |
| 848 | 848 | return c.emit(now, func(w io.Writer) { |
| 849 | | fmt.Fprintf(w, "topics on %s: %s\n", repo.Path(), strings.Join(now, ", ")) |
| 849 | for _, t := range now { |
| 850 | fmt.Fprintln(w, t) |
| 851 | } |
| 850 | 852 | }) |
| 851 | 853 | } |
| 852 | 854 | |
internal/control/status.go
+2 −6
| @@ -118,13 +118,9 @@ func runStatusList(c *Ctx, args []string) int { |
| 118 | 118 | Statuses []out `json:"statuses"` |
| 119 | 119 | }{full, combinedOf(statuses), ds} |
| 120 | 120 | return c.emit(d, func(w io.Writer) { |
| 121 | | fmt.Fprintf(w, "%.10s: %s\n", d.SHA, orNone(d.Combined)) |
| 121 | fmt.Fprintf(w, "combined\t%s\t%.10s\n", orNone(d.Combined), d.SHA) |
| 122 | 122 | for _, x := range ds { |
| 123 | | extra := "" |
| 124 | | if x.Description != "" { |
| 125 | | extra = "\t" + x.Description |
| 126 | | } |
| 127 | | fmt.Fprintf(w, " %s\t%s%s\n", x.Context, x.State, extra) |
| 123 | fmt.Fprintf(w, "%s\t%s\t%s\n", x.Context, x.State, x.Description) |
| 128 | 124 | } |
| 129 | 125 | }) |
| 130 | 126 | } |