File tree Expand file tree Collapse file tree 3 files changed +12
-17
lines changed Expand file tree Collapse file tree 3 files changed +12
-17
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -14,7 +14,19 @@ import (
14
14
"github.com/tomatool/tomato/tomato"
15
15
)
16
16
17
+ // AppHelpTemplate is the text template for the Default help topic.
18
+ // cli.go uses text/template to render templates. You can
19
+ // render custom help text by setting this variable.
20
+ const AppHelpTemplate = `Usage: {{if .UsageText}}{{.UsageText}}{{else}}tomato {{if .VisibleFlags}}[options]{{end}}{{if .ArgsUsage}}{{.ArgsUsage}}{{else}} <config path>{{end}}{{end}}
21
+
22
+ Options:
23
+ {{range $index, $option := .VisibleFlags}}{{if $index}}
24
+ {{end}}{{$option}}{{end}}
25
+ `
26
+
17
27
func main () {
28
+ cli .AppHelpTemplate = AppHelpTemplate
29
+
18
30
log := log .New (os .Stdout , "" , 0 )
19
31
20
32
app := cli .NewApp ()
Original file line number Diff line number Diff line change 9
9
"testing"
10
10
)
11
11
12
- func init () {}
13
-
14
12
func TestMain (t * testing.T ) {
15
13
var args []string
16
14
for _ , arg := range os .Args {
You can’t perform that action at this time.
0 commit comments