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

Method getArgValue

args.go:261–271  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

259)
260
261func (c *Command) getArgValue(name string) any {
262 tracef("command %s looking for args %s", c.Name, name)
263 for _, arg := range c.Arguments {
264 if arg.HasName(name) {
265 tracef("command %s found args %s", c.Name, name)
266 return arg.Get()
267 }
268 }
269 tracef("command %s did not find args %s", c.Name, name)
270 return nil
271}
272
273func arg[T any](name string, c *Command) T {
274 val := c.getArgValue(name)

Callers 1

argFunction · 0.80

Calls 3

tracefFunction · 0.85
HasNameMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected