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

Function DefaultShowRootCommandHelp

help.go:156–177  ·  help.go::DefaultShowRootCommandHelp

DefaultShowRootCommandHelp is the default implementation of ShowRootCommandHelp.

(cmd *Command)

Source from the content-addressed store, hash-verified

154
155// DefaultShowRootCommandHelp is the default implementation of ShowRootCommandHelp.
156func DefaultShowRootCommandHelp(cmd *Command) error {
157 tmpl := cmd.CustomRootCommandHelpTemplate
158 if tmpl == "" {
159 tracef("using RootCommandHelpTemplate")
160 tmpl = RootCommandHelpTemplate
161 }
162
163 if cmd.ExtraInfo == nil {
164 HelpPrinter(cmd.Root().Writer, tmpl, cmd.Root())
165 return nil
166 }
167
168 tracef("setting ExtraInfo in customAppData")
169 customAppData := func() map[string]any {
170 return map[string]any{
171 "ExtraInfo": cmd.ExtraInfo,
172 }
173 }
174 HelpPrinterCustom(cmd.Root().Writer, tmpl, cmd.Root(), customAppData())
175
176 return nil
177}
178
179// DefaultRootCommandComplete prints the list of subcommands as the default completion method.
180func DefaultRootCommandComplete(ctx context.Context, cmd *Command) {

Callers

nothing calls this directly

Calls 2

tracefFunction · 0.85
RootMethod · 0.80

Tested by

no test coverage detected