vole
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software:2222/vole.git
A free and open-source forge that lives in your Git repo.
Align the CLI with Git's command conventions
ade6107e546a7f1859ca4fe23a327d44871dce6d · Keenan Nemetz · 16d ago · parent 04e00cfc
cmd/vole/main.go +29−9
| @@ -32,7 +32,7 @@ func main() { | |||
| 32 | 32 | } | |
| 33 | 33 | ||
| 34 | 34 | func usage() { | |
| 35 | fmt.Fprint(os.Stderr, `vole - a small software forge built on git | ||
| 35 | fmt.Fprint(os.Stdout, `vole - a small software forge built on git | ||
| 36 | 36 | ||
| 37 | 37 | Git writes go over SSH, authenticated by your key. The web signs in with passkeys | |
| 38 | 38 | and accepts issue, comment, and approval writes. | |
| @@ -51,14 +51,15 @@ Usage: | |||
| 51 | 51 | index rebuild | |
| 52 | 52 | vole issue new --title "..." [-m text | -F file] [-l label]... [-a user]... | |
| 53 | 53 | vole issue comment <id> [-m text | -F file] | |
| 54 | vole issue edit-comment|rm-comment <id> <comment-id> [-m text | -F file] | ||
| 54 | vole issue edit-comment <id> <comment-id> [-m text | -F file] | ||
| 55 | vole issue rm-comment <id> <comment-id> | ||
| 55 | 56 | vole issue edit <id> [--title t] [-m text | -F file] [-l label]... [-a user]... [--unassign user]... | |
| 56 | 57 | vole issue assign|unassign <id> <user>... | |
| 57 | 58 | vole issue close|reopen <id> | |
| 58 | 59 | vole issue list [--state open|closed|all] [-l label]... [--assignee user]... [--format fmt] | |
| 59 | 60 | vole issue show <id> | |
| 60 | 61 | vole change new --title "..." --base <branch> [--head rev] [-m text | -F file] | |
| 61 | vole change list [--state open|closed] | ||
| 62 | vole change list [--state open|closed|all] [--format fmt] | ||
| 62 | 63 | vole change show <id> | |
| 63 | 64 | vole change update <id> --head <rev> | |
| 64 | 65 | vole change approve <id> [--as <user>] | |
| @@ -72,9 +73,11 @@ Usage: | |||
| 72 | 73 | vole workflow list [--dir path] | |
| 73 | 74 | vole workflow run [--dir path] [workflow]... [--job id]... | |
| 74 | 75 | ||
| 75 | Options follow git convention: --long value, --long=value, -o value, -ovalue. | ||
| 76 | Options may appear before or after arguments; -- ends option parsing. | ||
| 76 | Options follow git convention: --long value, --long=value, -o value, -ovalue, | ||
| 77 | bundled short options (-am), repeated options. Options may appear before or | ||
| 78 | after arguments; -- ends option parsing. | ||
| 77 | 79 | vole hook pre-receive|post-receive | |
| 80 | vole help [<command>] | ||
| 78 | 81 | vole version | |
| 79 | 82 | `) | |
| 80 | 83 | } | |
| @@ -91,6 +94,8 @@ func run(args []string) error { | |||
| 91 | 94 | return usagef("init is a server command; run `vole admin init` on the host") | |
| 92 | 95 | case "admin": | |
| 93 | 96 | return cmdAdmin(args[1:]) | |
| 97 | // Compatibility aliases for the pre-admin spellings. The documented | ||
| 98 | // namespace is `vole admin`; these keep old scripts working. | ||
| 94 | 99 | case "user": | |
| 95 | 100 | return cmdUser(args[1:]) | |
| 96 | 101 | case "repo": | |
| @@ -122,9 +127,24 @@ func run(args []string) error { | |||
| 122 | 127 | fmt.Println(version) | |
| 123 | 128 | return nil | |
| 124 | 129 | case "help", "-h", "--help": | |
| 125 | usage() | ||
| 126 | return nil | ||
| 130 | if len(args) == 1 { | ||
| 131 | usage() | ||
| 132 | return nil | ||
| 133 | } | ||
| 134 | return helpTopic(args[1]) | ||
| 135 | } | ||
| 136 | return fmt.Errorf("unknown command %q; run 'vole help' for a list of commands", args[0]) | ||
| 137 | } | ||
| 138 | |||
| 139 | // helpTopic keeps `vole help <command>` on the same path as `vole <command> | ||
| 140 | // -h`: the command parses its own flags and prints its own usage, and nothing | ||
| 141 | // else runs. | ||
| 142 | func helpTopic(name string) error { | ||
| 143 | switch name { | ||
| 144 | case "serve", "admin", "user", "repo", "acl", "index", "issue", | ||
| 145 | "change", "request", "requests", "cr", "workflow", "runner", | ||
| 146 | "release", "pages", "gc", "whoami": | ||
| 147 | return run([]string{name, "-h"}) | ||
| 127 | 148 | } | |
| 128 | usage() | ||
| 129 | return usagef("unknown command %q", args[0]) | ||
| 149 | return usagef("no help for %q; run 'vole help' for a list of commands", name) | ||
| 130 | 150 | } | |