Exemple #1
0
// 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)
}
Exemple #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)
}