Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

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/pages.go +12−4

@@ -12,6 +12,7 @@ package main
12 12
13 13 import (
14 14 "fmt"
15 "os"
15 16 "os/exec"
16 17 "strings"
17 18 "time"
@@ -22,7 +23,7 @@ import (
22 23 )
23 24
24 25 func pagesUsage() string {
25 return `usage: vole pages deploy [<dir>] [--branch <name>] [-m <text>] [--dry-run] [--remote <name>]
26 return `usage: vole pages deploy [<dir>] [--branch <name>] [-m <text> | -F <file>] [--dry-run] [--remote <name>]
26 27 or: vole pages status [--branch <name>] [--remote <name>]
27 28 or: vole pages unpublish [--branch <name>] [--remote <name>]
28 29
@@ -36,7 +37,8 @@ operator changed pages_ref, pass the same branch name here.`
36 37
37 38 func cmdPages(args []string) error {
38 39 if len(args) == 0 {
39 return usageErr{msg: "usage: vole pages deploy|status|unpublish [options]"}
40 fmt.Fprintln(os.Stderr, pagesUsage())
41 return usageErr{msg: "no pages subcommand given"}
40 42 }
41 43 switch args[0] {
42 44 case "deploy":
@@ -49,6 +51,7 @@ func cmdPages(args []string) error {
49 51 fmt.Println(pagesUsage())
50 52 return nil
51 53 }
54 fmt.Fprintln(os.Stderr, pagesUsage())
52 55 return usagef("unknown pages subcommand %q", args[0])
53 56 }
54 57
@@ -97,6 +100,7 @@ func cmdPagesDeploy(args []string) error {
97 100 flagSpec{long: "branch"},
98 101 flagSpec{long: "remote"},
99 102 flagSpec{long: "message", short: "m"},
103 flagSpec{long: "file", short: "F"},
100 104 flagSpec{long: "dry-run", boolean: true},
101 105 flagSpec{long: "help", short: "h", boolean: true},
102 106 )
@@ -108,17 +112,21 @@ func cmdPagesDeploy(args []string) error {
108 112 return nil
109 113 }
110 114 if len(f.rest) > 1 {
111 return usageErr{msg: "usage: vole pages deploy [<dir>] [--branch <name>] [-m <text>] [--dry-run]"}
115 return usageErr{msg: "usage: vole pages deploy [<dir>] [--branch <name>] [-m <text> | -F <file>] [--dry-run]"}
112 116 }
113 117 dir := "."
114 118 if len(f.rest) == 1 {
115 119 dir = f.rest[0]
116 120 }
121 message, err := readBody(f)
122 if err != nil {
123 return err
124 }
117 125 c, branch, err := siteCLI(f)
118 126 if err != nil {
119 127 return err
120 128 }
121 diff, files, deployed, err := client.DeploySite(c, dir, f.one("message"), f.has("dry-run"))
129 diff, files, deployed, err := client.DeploySite(c, dir, message, f.has("dry-run"))
122 130 if err != nil {
123 131 return err
124 132 }