File tree Expand file tree Collapse file tree 3 files changed +2
-4
lines changed
Expand file tree Collapse file tree 3 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,6 @@ func WithCustomStdout(writers ...io.Writer) func(c *Command) {
8787 return func (c * Command ) {
8888 writers = append (writers , & c .stdout , & c .combined )
8989 c .StdoutWriter = NewMultiplexedWriter (writers ... )
90-
91- c .StderrWriter = NewMultiplexedWriter (& c .stderr , & c .combined )
9290 }
9391}
9492
@@ -97,8 +95,6 @@ func WithCustomStderr(writers ...io.Writer) func(c *Command) {
9795 return func (c * Command ) {
9896 writers = append (writers , & c .stderr , & c .combined )
9997 c .StderrWriter = NewMultiplexedWriter (writers ... )
100-
101- c .StdoutWriter = NewMultiplexedWriter (& c .stdout , & c .combined )
10298 }
10399}
104100
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package examples
22
33import "github.com/SimonBaeumer/cmd"
44
5+ // CreateNewCommandWithStandardStream create new standard stream example
56func CreateNewCommandWithStandardStream () {
67 c := cmd .NewCommand ("echo hello; sleep 1; echo another;" , cmd .WithStandardStreams )
78 c .Execute ()
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package examples
22
33import "github.com/SimonBaeumer/cmd"
44
5+ // CreateWithWorkingDir sets the current working directory
56func CreateWithWorkingDir () {
67 setWorkingDir := func (c * cmd.Command ) {
78 c .WorkingDir = "/tmp"
You can’t perform that action at this time.
0 commit comments