(n int, options []string)
| 127 | } |
| 128 | |
| 129 | func (ls *LState) CheckOption(n int, options []string) int { |
| 130 | str := ls.CheckString(n) |
| 131 | for i, v := range options { |
| 132 | if v == str { |
| 133 | return i |
| 134 | } |
| 135 | } |
| 136 | ls.ArgError(n, fmt.Sprintf("invalid option: %s (must be one of %s)", str, strings.Join(options, ","))) |
| 137 | return 0 |
| 138 | } |
| 139 | |
| 140 | /* }}} */ |
| 141 |