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

Method hasPersistentFlagOnAncestor

command.go:367–381  ·  command.go::Command.hasPersistentFlagOnAncestor
(fl Flag)

Source from the content-addressed store, hash-verified

365}
366
367func (cmd *Command) hasPersistentFlagOnAncestor(fl Flag) bool {
368 for pCmd := cmd.parent; pCmd != nil; pCmd = pCmd.parent {
369 for _, pFl := range pCmd.allFlags() {
370 if pFl != fl {
371 continue
372 }
373
374 pfl, ok := pFl.(LocalFlag)
375 if ok && !pfl.IsLocal() {
376 return true
377 }
378 }
379 }
380 return false
381}
382
383func (cmd *Command) lookupFlag(name string) Flag {
384 for _, pCmd := range cmd.Lineage() {

Callers 1

runMethod · 0.95

Calls 2

allFlagsMethod · 0.80
IsLocalMethod · 0.65

Tested by

no test coverage detected