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

Method IsSet

command.go:501–516  ·  command.go::Command.IsSet

IsSet determines if the flag was actually set

(name string)

Source from the content-addressed store, hash-verified

499
500// IsSet determines if the flag was actually set
501func (cmd *Command) IsSet(name string) bool {
502 fl := cmd.lookupFlag(name)
503 if fl == nil {
504 tracef("flag with name %[1]q NOT found; assuming not set (cmd=%[2]q)", name, cmd.Name)
505 return false
506 }
507
508 isSet := fl.IsSet()
509 if isSet {
510 tracef("flag with name %[1]q is set (cmd=%[2]q)", name, cmd.Name)
511 } else {
512 tracef("flag with name %[1]q is no set (cmd=%[2]q)", name, cmd.Name)
513 }
514
515 return isSet
516}
517
518// LocalFlagNames returns a slice of flag names used in this
519// command.

Callers 4

TestCommand_IsSetFunction · 0.95
TestCommand_SetFunction · 0.95

Calls 3

lookupFlagMethod · 0.95
tracefFunction · 0.85
IsSetMethod · 0.65

Tested by 4

TestCommand_IsSetFunction · 0.76
TestCommand_SetFunction · 0.76