Esempio n. 1
0
func subcommandHelp(reg *cookoo.Registry) string {
	names := reg.RouteNames()
	helptext := make([]string, 0, len(names))
	for _, name := range names {
		if strings.HasPrefix(name, "@") {
			continue
		}

		rs, _ := reg.RouteSpec(name)
		help := fmt.Sprintf("\t%s: %s", name, cookoo.RouteDetails(rs).Description())
		helptext = append(helptext, help)
	}
	return strings.Join(helptext, "\n")
}