MCPcopy
hub / github.com/urfave/cli / VisibleCategories

Method VisibleCategories

command.go:249–262  ·  command.go::Command.VisibleCategories

VisibleCategories returns a slice of categories and commands that are Hidden=false

()

Source from the content-addressed store, hash-verified

247// VisibleCategories returns a slice of categories and commands that are
248// Hidden=false
249func (cmd *Command) VisibleCategories() []CommandCategory {
250 ret := []CommandCategory{}
251 for _, category := range cmd.categories.Categories() {
252 if visible := func() CommandCategory {
253 if len(category.VisibleCommands()) > 0 {
254 return category
255 }
256 return nil
257 }(); visible != nil {
258 ret = append(ret, visible)
259 }
260 }
261 return ret
262}
263
264// VisibleCommands returns a slice of the Commands with Hidden=false
265func (cmd *Command) VisibleCommands() []*Command {

Callers 1

Calls 2

CategoriesMethod · 0.65
VisibleCommandsMethod · 0.65

Tested by 1