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) {
87
87
return func (c * Command ) {
88
88
writers = append (writers , & c .stdout , & c .combined )
89
89
c .StdoutWriter = NewMultiplexedWriter (writers ... )
90
-
91
- c .StderrWriter = NewMultiplexedWriter (& c .stderr , & c .combined )
92
90
}
93
91
}
94
92
@@ -97,8 +95,6 @@ func WithCustomStderr(writers ...io.Writer) func(c *Command) {
97
95
return func (c * Command ) {
98
96
writers = append (writers , & c .stderr , & c .combined )
99
97
c .StderrWriter = NewMultiplexedWriter (writers ... )
100
-
101
- c .StdoutWriter = NewMultiplexedWriter (& c .stdout , & c .combined )
102
98
}
103
99
}
104
100
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package examples
2
2
3
3
import "github.com/SimonBaeumer/cmd"
4
4
5
+ // CreateNewCommandWithStandardStream create new standard stream example
5
6
func CreateNewCommandWithStandardStream () {
6
7
c := cmd .NewCommand ("echo hello; sleep 1; echo another;" , cmd .WithStandardStreams )
7
8
c .Execute ()
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package examples
2
2
3
3
import "github.com/SimonBaeumer/cmd"
4
4
5
+ // CreateWithWorkingDir sets the current working directory
5
6
func CreateWithWorkingDir () {
6
7
setWorkingDir := func (c * cmd.Command ) {
7
8
c .WorkingDir = "/tmp"
You can’t perform that action at this time.
0 commit comments