@@ -147,16 +147,17 @@ type Options struct {
147
147
// See Cmd.Status for more info.
148
148
Buffered bool
149
149
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 .
154
154
CombinedOutput bool
155
155
156
156
// If Streaming is true, Cmd.Stdout and Cmd.Stderr channels are created and
157
157
// STDOUT and STDERR output lines are written them in real time. This is
158
158
// 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.
160
161
Streaming bool
161
162
162
163
// BeforeExec is a list of functions called immediately before starting
@@ -166,8 +167,7 @@ type Options struct {
166
167
167
168
// LineBufferSize sets the size of the OutputStream line buffer. The default
168
169
// 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.
171
171
LineBufferSize uint
172
172
}
173
173
@@ -227,10 +227,9 @@ func NewCmdOptions(options Options, name string, args ...string) *Cmd {
227
227
return c
228
228
}
229
229
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.
234
233
func (c * Cmd ) Clone () * Cmd {
235
234
clone := NewCmdOptions (
236
235
Options {
@@ -340,8 +339,7 @@ func (c *Cmd) Stop() error {
340
339
// consider using streaming output. When the command finishes, buffered output
341
340
// is complete and final.
342
341
//
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.
345
343
func (c * Cmd ) Status () Status {
346
344
c .Lock ()
347
345
defer c .Unlock ()
0 commit comments