(ctx context.Context, engine storage.Engine)
| 126 | } |
| 127 | |
| 128 | func (f *Flags) Open(ctx context.Context, engine storage.Engine) (vio.PushCloser, error) { |
| 129 | if f.split != "" { |
| 130 | dir, err := storage.ParseURI(f.split) |
| 131 | if err != nil { |
| 132 | return nil, fmt.Errorf("-split option: %w", err) |
| 133 | } |
| 134 | if size := f.splitSize.Bytes; size > 0 { |
| 135 | return emitter.NewSizeSplitter(ctx, engine, dir, f.outputFile, f.unbuffered, f.WriterOpts, int64(size)) |
| 136 | } |
| 137 | d, err := emitter.NewSplit(ctx, engine, dir, f.outputFile, f.unbuffered, f.WriterOpts) |
| 138 | if err != nil { |
| 139 | return nil, err |
| 140 | } |
| 141 | return d, nil |
| 142 | } |
| 143 | if f.outputFile == "" && f.color && terminal.IsTerminalFile(os.Stdout) { |
| 144 | color.Enabled = true |
| 145 | } |
| 146 | w, err := emitter.NewFileFromPath(ctx, engine, f.outputFile, f.unbuffered, f.WriterOpts) |
| 147 | if err != nil { |
| 148 | return nil, err |
| 149 | } |
| 150 | return w, nil |
| 151 | } |
nothing calls this directly
no test coverage detected