ensureMaxArgs checks if the number of arguments is as expected
( ctx context.Context, name string, args []string, maxArgs int, )
| 18 | |
| 19 | // ensureMaxArgs checks if the number of arguments is as expected |
| 20 | func (p *Parser) ensureMaxArgs( |
| 21 | ctx context.Context, |
| 22 | name string, |
| 23 | args []string, |
| 24 | maxArgs int, |
| 25 | ) error { |
| 26 | if len(args) > maxArgs { |
| 27 | return newInvalidArgsError(ctx, name, args) |
| 28 | } |
| 29 | return nil |
| 30 | } |
| 31 | |
| 32 | // parseBool parses a boolean option value and warns if the value is invalid |
| 33 | func (p *Parser) parseBool( |
no test coverage detected