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

Method checkAllRequiredFlags

command.go:420–433  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

418}
419
420func (cmd *Command) checkAllRequiredFlags() requiredFlagsErr {
421 // The help and completion commands are allowed to run without
422 // enforcement of required flags, since they do not invoke user
423 // actions that depend on those flag values.
424 if cmd.builtInHelp || cmd.isCompletionCommand {
425 return nil
426 }
427 for pCmd := cmd; pCmd != nil; pCmd = pCmd.parent {
428 if err := pCmd.checkRequiredFlags(); err != nil {
429 return err
430 }
431 }
432 return nil
433}
434
435func (cmd *Command) checkRequiredFlags() requiredFlagsErr {
436 tracef("checking for required flags (cmd=%[1]q)", cmd.Name)

Callers 2

runMethod · 0.95
TestCheckRequiredFlagsFunction · 0.95

Calls 1

checkRequiredFlagsMethod · 0.80

Tested by 1

TestCheckRequiredFlagsFunction · 0.76