(ctx context.Context, o *options.Options, args []string)
| 44 | } |
| 45 | |
| 46 | func (p *Parser) applySizeOption(ctx context.Context, o *options.Options, args []string) (err error) { |
| 47 | if err = p.ensureMaxArgs(ctx, "size", args, 7); err != nil { |
| 48 | return |
| 49 | } |
| 50 | |
| 51 | if len(args) >= 1 && len(args[0]) > 0 { |
| 52 | if err = p.applyWidthOption(ctx, o, args[0:1]); err != nil { |
| 53 | return |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | if len(args) >= 2 && len(args[1]) > 0 { |
| 58 | if err = p.applyHeightOption(ctx, o, args[1:2]); err != nil { |
| 59 | return |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | if len(args) >= 3 && len(args[2]) > 0 { |
| 64 | if err = p.applyEnlargeOption(ctx, o, args[2:3]); err != nil { |
| 65 | return |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | if len(args) >= 4 && len(args[3]) > 0 { |
| 70 | if err = p.applyExtendOption(ctx, o, args[3:]); err != nil { |
| 71 | return |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | return nil |
| 76 | } |
| 77 | |
| 78 | func (p *Parser) applyResizingTypeOption(ctx context.Context, o *options.Options, args []string) error { |
| 79 | return parseFromMap(ctx, p, o, keys.ResizingType, processing.ResizeTypes, args...) |
no test coverage detected