help.go 745 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package command
  2. import (
  3. "github.com/codegangsta/cli"
  4. "os"
  5. "path"
  6. )
  7. func init() {
  8. cli.AppHelpTemplate = `Usage: {{.Name}} {{if .Flags}}[OPTIONS] {{end}}COMMAND [arg...]
  9. {{.Usage}}
  10. Version: {{.Version}}{{if or .Author .Email}}
  11. Author:{{if .Author}}
  12. {{.Author}}{{if .Email}} - <{{.Email}}>{{end}}{{else}}
  13. {{.Email}}{{end}}{{end}}
  14. {{if .Flags}}
  15. Options:
  16. {{range .Flags}}{{.}}
  17. {{end}}{{end}}
  18. Commands:
  19. {{range .Commands}}{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Usage}}
  20. {{end}}
  21. Run '{{.Name}} COMMAND --help' for more information on a command.
  22. `
  23. cli.CommandHelpTemplate = `Usage: ` + path.Base(os.Args[0]) + ` {{.Name}}{{if .Flags}} [OPTIONS]
  24. {{.Usage}}
  25. Options:
  26. {{range .Flags}}{{.}}
  27. {{end}}{{end}}
  28. `
  29. }