(name string)
| 259 | ) |
| 260 | |
| 261 | func (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 | |
| 273 | func arg[T any](name string, c *Command) T { |
| 274 | val := c.getArgValue(name) |