Skip to content

Commit 59bbfe0

Browse files
committed
Use raw string literal to simplify help text and use list separator everywhere
Signed-off-by: Jack Baldry <[email protected]>
1 parent 7570e7a commit 59bbfe0

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

main.go

+15-14
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,21 @@ func printVersion(w io.Writer) {
4545
// printVersion prints help text to the provided writer.
4646
func printHelp(w io.Writer) {
4747
printVersion(w)
48-
fmt.Fprintln(w)
49-
fmt.Fprintf(w, "Options:\n")
50-
fmt.Fprintf(w, " -h / --help Print this help message.\n")
51-
fmt.Fprintf(w, " -J / --jpath <dir> Specify an additional library search dir\n")
52-
fmt.Fprintf(w, " (right-most wins).\n")
53-
fmt.Fprintf(w, " -v / --version Print version.\n")
54-
fmt.Fprintln(w)
55-
fmt.Fprintf(w, "Environment variables:\n")
56-
fmt.Fprintf(w, " JSONNET_PATH is a %q separated list of directories\n", filepath.ListSeparator)
57-
fmt.Fprintf(w, " added in reverse order before the paths specified by --jpath.\n")
58-
fmt.Fprintf(w, " These are equivalent:\n")
59-
fmt.Fprintf(w, " JSONNET_PATH=a:b %s -J c -J d\n", name)
60-
fmt.Fprintf(w, " JSONNET_PATH=d:c:a:b %s\n", name)
61-
fmt.Fprintf(w, " %s -J b -J a -J c -J d\n", name)
48+
fmt.Fprintf(w, `
49+
Options:
50+
-h / --help Print this help message.
51+
-J / --jpath <dir> Specify an additional library search dir
52+
(right-most wins).
53+
-v / --version Print version.
54+
55+
Environment variables:
56+
JSONNET_PATH is a %[2]q separated list of directories
57+
added in reverse order before the paths specified by --jpath
58+
These are equivalent:
59+
JSONNET_PATH=a%[2]cb %[1]s -J c -J d
60+
JSONNET_PATH=d%[2]cc%[2]ca%[2]cb %[1]s\n
61+
%[1]s -J b -J a -J c -J d
62+
`, name, filepath.ListSeparator)
6263
}
6364

6465
func main() {

0 commit comments

Comments
 (0)