forked from docker-archive/classicswarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
help.go
31 lines (27 loc) · 938 Bytes
/
help.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"os"
"path"
"github.com/codegangsta/cli"
)
func init() {
// See https://github.com/codegangsta/cli/pull/171/files
cli.CommandHelpTemplate = `{{$DISCOVERY := or (eq .Name "manage") (eq .Name "join") (eq .Name "list")}}NAME:
{{.Name}} - {{.Usage}}
USAGE:
` + path.Base(os.Args[0]) + ` {{.Name}}{{if .Flags}} [options]{{end}} {{if $DISCOVERY}}<discovery>{{end}}{{if .Description}}
DESCRIPTION:
{{.Description}}{{end}}{{if $DISCOVERY}}
ARGUMENTS:
discovery{{printf "\t"}}discovery service to use [$SWARM_DISCOVERY]
{{printf "\t"}} * token://<token>
{{printf "\t"}} * consul://<ip1>,<ip2>/<path>
{{printf "\t"}} * etcd://<ip1>,<ip2>/<path>
{{printf "\t"}} * file://path/to/file
{{printf "\t"}} * zk://<ip1>,<ip2>/<path>
{{printf "\t"}} * <ip1>,<ip2>{{end}}{{if .Flags}}
OPTIONS:
{{range .Flags}}{{.}}
{{end}}{{ end }}
`
}