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

Method checkRequiredFlag

command.go:410–418  ·  view source on GitHub ↗
(f Flag)

Source from the content-addressed store, hash-verified

408}
409
410func (cmd *Command) checkRequiredFlag(f Flag) (bool, string) {
411 if rf, ok := f.(RequiredFlag); ok && rf.IsRequired() {
412 flagName := f.Names()[0]
413 if !f.IsSet() {
414 return false, flagName
415 }
416 }
417 return true, ""
418}
419
420func (cmd *Command) checkAllRequiredFlags() requiredFlagsErr {
421 // The help and completion commands are allowed to run without

Callers 1

checkRequiredFlagsMethod · 0.95

Calls 3

IsRequiredMethod · 0.65
NamesMethod · 0.65
IsSetMethod · 0.65

Tested by

no test coverage detected