@@ -147,16 +147,17 @@ type Options struct {
147147// See Cmd.Status for more info.
148148Buffered bool
149149
150- // If CombinedOutput is true, STDOUT and STDERR are written to Status.Stdout ONLY similar to 2>&1.
151- // If CombinedOutput is used at the same time as Buffered, CombinedOutput will take preference.
152- // Status.StdErr will be empty. The caller can call Cmd.Status to read output at intervals.
153- // See Cmd.Status for more info .
150+ // If CombinedOutput is true, STDOUT and STDERR are written only to Status.Stdout
151+ // (similar to 2>&1 on Linux), and Status.StdErr will be empty. If CombinedOutput
152+ // is used Buffered, CombinedOutput takes preference. CombinedOutput does not work
153+ // with Streaming .
154154CombinedOutput bool
155155
156156// If Streaming is true, Cmd.Stdout and Cmd.Stderr channels are created and
157157// STDOUT and STDERR output lines are written them in real time. This is
158158// faster and more efficient than polling Cmd.Status. The caller must read both
159- // streaming channels, else lines are dropped silently.
159+ // streaming channels, else lines are dropped silently. Streaming does not work
160+ // with CombinedOutput.
160161Streaming bool
161162
162163// BeforeExec is a list of functions called immediately before starting
@@ -166,8 +167,7 @@ type Options struct {
166167
167168// LineBufferSize sets the size of the OutputStream line buffer. The default
168169// value DEFAULT_LINE_BUFFER_SIZE is usually sufficient, but if
169- // ErrLineBufferOverflow errors occur, try increasing the size with this
170- // field.
170+ // ErrLineBufferOverflow errors occur, try increasing the size with this field.
171171LineBufferSize uint
172172}
173173
@@ -227,10 +227,9 @@ func NewCmdOptions(options Options, name string, args ...string) *Cmd {
227227return c
228228}
229229
230- // Clone clones a Cmd. All the options are transferred,
231- // but the internal state of the original object is lost.
232- // Cmd is one-use only, so if you need to re-start a Cmd,
233- // you need to Clone it.
230+ // Clone clones a Cmd. All the options are transferred, but the internal state
231+ // of the original object is lost. Cmd is one-use only, so if you need to restart
232+ // a Cmd, you need to Clone it.
234233func (c * Cmd ) Clone () * Cmd {
235234clone := NewCmdOptions (
236235Options {
@@ -340,8 +339,7 @@ func (c *Cmd) Stop() error {
340339// consider using streaming output. When the command finishes, buffered output
341340// is complete and final.
342341//
343- // Status.Runtime is updated while the command is running and final when it
344- // finishes.
342+ // Status.Runtime is updated while the command runs and is final when it finishes.
345343func (c * Cmd ) Status () Status {
346344c .Lock ()
347345defer c .Unlock ()
0 commit comments