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

Method Set

command.go:491–498  ·  view source on GitHub ↗

Set sets a context flag to a value.

(name, value string)

Source from the content-addressed store, hash-verified

489
490// Set sets a context flag to a value.
491func (cmd *Command) Set(name, value string) error {
492 if f := cmd.lookupFlag(name); f != nil {
493 cmd.setMultiValueParsingConfig(f)
494 return f.Set(name, value)
495 }
496
497 return fmt.Errorf("no such flag -%s", name)
498}
499
500// IsSet determines if the flag was actually set
501func (cmd *Command) IsSet(name string) bool {

Calls 3

lookupFlagMethod · 0.95
SetMethod · 0.65