WithStandardStreams sets a cli in, out and err streams with the standard streams.
()
| 22 | |
| 23 | // WithStandardStreams sets a cli in, out and err streams with the standard streams. |
| 24 | func WithStandardStreams() CLIOption { |
| 25 | return func(cli *DockerCli) error { |
| 26 | // Set terminal emulation based on platform as required. |
| 27 | stdin, stdout, stderr := term.StdStreams() |
| 28 | cli.in = streams.NewIn(stdin) |
| 29 | cli.out = streams.NewOut(stdout) |
| 30 | cli.err = streams.NewOut(stderr) |
| 31 | return nil |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | // WithBaseContext sets the base context of a cli. It is used to propagate |
| 36 | // the context from the command line to the client. |
no outgoing calls
no test coverage detected
searching dependent graphs…