func (c *SuperCommand) describeCommands(simple bool) string {
	var lineFormat = "    %-*s - %s"
	var outputFormat = "commands:\n%s"
	if simple {
		lineFormat = "%-*s  %s"
		outputFormat = "%s"
	}
	cmds := make([]string, len(c.subcmds))
	i := 0
	longest := 0
	for name := range c.subcmds {
		if len(name) > longest {
			longest = len(name)
		}
		cmds[i] = name
		i++
	}
	sort.Strings(cmds)
	var result []string
	for _, name := range cmds {
		action := c.subcmds[name]
		if deprecated, _ := action.Deprecated(); deprecated {
			continue
		}
		info := action.command.Info()
		purpose := info.Purpose
		if action.alias != "" {
			purpose = "Alias for '" + action.alias + "'."
		}
		result = append(result, fmt.Sprintf(lineFormat, longest, name, purpose))
	}
	return fmt.Sprintf(outputFormat, strings.Join(result, "\n"))
}
// describeCommands returns a short description of each registered subcommand.
describeCommands returns a short description of each registered subcommand.
// describeCommands returns a short description of each registered subcommand .
func (c *SuperCommand) describeCommands(simple bool) string {
	var lineFormat = "    %-*s - %s"
	var outputFormat = "commands:\n%s"
	if simple {
		lineFormat = "%-*s  %s"
		outputFormat = "%s"
	}
	cmds := make([]string, len(c.subcmds))
	i := 0
	longest := 0
	for name := range c.subcmds {
		if len(name) > longest {
			longest = len(name)
		}
		cmds[i] = name
		i++
	}
	sort.Strings(cmds)
	var result []string
	for _, name := range cmds {
		action := c.subcmds[name]
		if deprecated, _ := action.Deprecated(); deprecated {
			continue
		}
		info := action.command.Info()
		purpose := info.Purpose
		if action.alias != "" {
			purpose = "Alias for '" + action.alias + "'."
		}
		result = append(result, fmt.Sprintf(lineFormat, longest, name, purpose))
	}
	return fmt.Sprintf(outputFormat, strings.Join(result, "\n"))
}
func ( c * SuperCommand ) describeCommands ( simple bool ) string { var lineFormat = " " var outputFormat = " \n " if simple { lineFormat = " " outputFormat = " " } cmds := make ( [ ] string , len ( c . subcmds ) ) i := 0 longest := 0 for name := range c . subcmds { if len ( name ) > longest { longest = len ( name ) } cmds [ i ] = name i ++ } sort . Strings ( cmds ) var result [ ] string for _ , name := range cmds { action := c . subcmds [ name ] if deprecated , _ := action . Deprecated ( ) ; deprecated { continue } info := action . command . Info ( ) purpose := info . Purpose if action . alias != " " { purpose = " " + action . alias + " " } result = append ( result , fmt . Sprintf ( lineFormat , longest , name , purpose ) ) } return fmt . Sprintf ( outputFormat , strings . Join ( result , " \n " ) ) }
describeCommands returns a short description of each registered subcommand.
describeCommands returns a short description of each registered subcommand .