예제 #1
0
파일: server.go 프로젝트: qinguoan/vulcan
// Usage returns the full usage string including all of the flags.
func (s *Server) Usage() error {
	tt := `{{if .Long}}{{.Long | trim | wrap ""}}
{{end}}Usage:
  {{.SimpleUsage}} [flags]

Available Flags:
{{.Flags.FlagUsages}}`

	return util.ExecuteTemplate(s.hk.Out(), tt, s)
}
예제 #2
0
// Usage will write out a summary for all servers that this binary supports.
func (hk *HyperKube) Usage() {
	tt := `{{if .Long}}{{.Long | trim | wrap ""}}
{{end}}Usage

  {{.Name}} <server> [flags]

Servers
{{range .Servers}}
  {{.Name}}
{{.Long | trim | wrap "    "}}{{end}}
Call '{{.Name}} <server> --help' for help on a specific server.
`
	util.ExecuteTemplate(hk.Out(), tt, hk)
}