GetArg returns the argument definition corresponding to the given name.
(name string)
| 1056 | |
| 1057 | // GetArg returns the argument definition corresponding to the given name. |
| 1058 | func (f *modFunction) GetArg(name string) (*modFunctionArg, error) { |
| 1059 | for _, a := range f.Args { |
| 1060 | if a.FlagName() == name { |
| 1061 | return a, nil |
| 1062 | } |
| 1063 | } |
| 1064 | return nil, fmt.Errorf("no argument %q in function %q", name, f.CmdName()) |
| 1065 | } |
| 1066 | |
| 1067 | func (f *modFunction) HasRequiredArgs() bool { |
| 1068 | for _, arg := range f.Args { |
no test coverage detected