func (c *SuperCommand) Info() *Info {
	if c.action.command != nil {
		info := *c.action.command.Info()
		info.Name = fmt.Sprintf("%s %s", c.Name, info.Name)
		info.FlagKnownAs = c.FlagKnownAs
		return &info
	}
	docParts := []string{}
	if doc := strings.TrimSpace(c.Doc); doc != "" {
		docParts = append(docParts, doc)
	}
	if cmds := c.describeCommands(false); cmds != "" {
		docParts = append(docParts, cmds)
	}
	return &Info{
		Name:        c.Name,
		Args:        "<command> ...",
		Purpose:     c.Purpose,
		Doc:         strings.Join(docParts, "\n\n"),
		Aliases:     c.Aliases,
		FlagKnownAs: c.FlagKnownAs,
	}
}
// Info returns a description of the currently selected subcommand, or of the
// SuperCommand itself if no subcommand has been specified.
Info returns a description of the currently selected subcommand, or of the
SuperCommand itself if no subcommand has been specified.
// Info returns a description of the currently selected subcommand or of the // SuperCommand itself if no subcommand has been specified .
func (c *SuperCommand) Info() *Info {
	if c.action.command != nil {
		info := *c.action.command.Info()
		info.Name = fmt.Sprintf("%s %s", c.Name, info.Name)
		info.FlagKnownAs = c.FlagKnownAs
		return &info
	}
	docParts := []string{}
	if doc := strings.TrimSpace(c.Doc); doc != "" {
		docParts = append(docParts, doc)
	}
	if cmds := c.describeCommands(false); cmds != "" {
		docParts = append(docParts, cmds)
	}
	return &Info{
		Name:        c.Name,
		Args:        "<command> ...",
		Purpose:     c.Purpose,
		Doc:         strings.Join(docParts, "\n\n"),
		Aliases:     c.Aliases,
		FlagKnownAs: c.FlagKnownAs,
	}
}
func ( c * SuperCommand ) Info ( ) * Info { if c . action . command != nil { info := * c . action . command . Info ( ) info . Name = fmt . Sprintf ( " " , c . Name , info . Name ) info . FlagKnownAs = c . FlagKnownAs return & info } docParts := [ ] string { } if doc := strings . TrimSpace ( c . Doc ) ; doc != " " { docParts = append ( docParts , doc ) } if cmds := c . describeCommands ( false ) ; cmds != " " { docParts = append ( docParts , cmds ) } return & Info { Name : c . Name , Args : " " , Purpose : c . Purpose , Doc : strings . Join ( docParts , " \n \n " ) , Aliases : c . Aliases , FlagKnownAs : c . FlagKnownAs , } }
Info returns a description of the currently selected subcommand, or of the
SuperCommand itself if no subcommand has been specified.
Info returns a description of the currently selected subcommand or of the SuperCommand itself if no subcommand has been specified .