Skip to content

Commit 9c2d75a

Browse files
committed
docs: cleanup
1 parent ad87f21 commit 9c2d75a

File tree

12 files changed

+25
-23
lines changed

12 files changed

+25
-23
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ type Result struct {
141141
142142
## Pipelining
143143
144-
Chain commands safely:
144+
Chain commands safely (pipeline execution is cross-platform; the commands you choose must exist on that OS):
145145
146146
```go
147147
out, err := execx.
@@ -151,7 +151,9 @@ out, err := execx.
151151
Output()
152152
```
153153
154-
Pipelines are explicit and deterministic.
154+
Pipelines are explicit and deterministic. `PipeStrict` stops at the first failing stage and returns its error. `PipeBestEffort` still runs all stages, returns the last stage output, and surfaces the first error if any stage failed.
155+
156+
On Windows, use `cmd /c` or `powershell -Command` to access shell built-ins when needed.
155157
156158
```go
157159
cmd := execx.Command("ps", "aux").Pipe("grep", "nginx")
@@ -602,7 +604,7 @@ fmt.Println(execx.Command("go", "env", "GOOS").HideWindow(true) != nil)
602604
603605
### <a id="pdeathsig"></a>Pdeathsig
604606
605-
Pdeathsig is a no-op on non-Linux Unix platforms.
607+
Pdeathsig sets a parent-death signal on Linux.
606608
607609
_Example: pdeathsig_
608610
@@ -679,7 +681,7 @@ fmt.Println(execx.Command("go", "env", "GOOS").Setsid(true) != nil)
679681
680682
### <a id="pipe"></a>Pipe
681683
682-
Pipe appends a new command to the pipeline.
684+
Pipe appends a new command to the pipeline. Pipelines run on all platforms.
683685
684686
```go
685687
out, _ := execx.Command("printf", "go").
@@ -691,7 +693,7 @@ fmt.Println(out)
691693
692694
### <a id="pipebesteffort"></a>PipeBestEffort
693695
694-
PipeBestEffort sets best-effort pipeline semantics.
696+
PipeBestEffort sets best-effort pipeline semantics (run all stages, surface the first error).
695697
696698
```go
697699
res, err := execx.Command("false").
@@ -704,7 +706,7 @@ fmt.Println(err == nil && res.Stdout == "ok")
704706
705707
### <a id="pipestrict"></a>PipeStrict
706708
707-
PipeStrict sets strict pipeline semantics.
709+
PipeStrict sets strict pipeline semantics (stop on first failure).
708710
709711
```go
710712
res, _ := execx.Command("false").
@@ -850,7 +852,7 @@ fmt.Println(err == nil)
850852
// flag provided but not defined: -badflag
851853
// usage: go env [-json] [-changed] [-u] [-w] [var ...]
852854
// Run 'go help env' for details.
853-
// false
855+
// true
854856
```
855857
856858
### <a id="onstdout"></a>OnStdout
@@ -878,7 +880,7 @@ fmt.Println(err == nil)
878880
// flag provided but not defined: -badflag
879881
// usage: go env [-json] [-changed] [-u] [-w] [var ...]
880882
// Run 'go help env' for details.
881-
// false
883+
// true
882884
```
883885
884886
### <a id="stdoutwriter"></a>StdoutWriter

examples/creationflags/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func main() {
12-
// CreationFlags sets Windows creation flags.
12+
// CreationFlags is a no-op on non-Windows platforms.
1313

1414
// Example: creation flags
1515
fmt.Println(execx.Command("go", "env", "GOOS").CreationFlags(0) != nil)

examples/hidewindow/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func main() {
12-
// HideWindow controls window visibility and sets CREATE_NO_WINDOW for console apps.
12+
// HideWindow is a no-op on non-Windows platforms.
1313

1414
// Example: hide window
1515
fmt.Println(execx.Command("go", "env", "GOOS").HideWindow(true) != nil)

examples/onstderr/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ func main() {
2323
// flag provided but not defined: -badflag
2424
// usage: go env [-json] [-changed] [-u] [-w] [var ...]
2525
// Run 'go help env' for details.
26-
// false
26+
// true
2727
}

examples/pdeathsig/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func main() {
12-
// Pdeathsig is a no-op on Windows.
12+
// Pdeathsig is a no-op on non-Linux Unix platforms.
1313

1414
// Example: pdeathsig
1515
fmt.Println(execx.Command("go", "env", "GOOS").Pdeathsig(0) != nil)

examples/pipe/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func main() {
12-
// Pipe appends a new command to the pipeline.
12+
// Pipe appends a new command to the pipeline. Pipelines run on all platforms.
1313

1414
// Example: pipe
1515
out, _ := execx.Command("printf", "go").

examples/pipebesteffort/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func main() {
12-
// PipeBestEffort sets best-effort pipeline semantics.
12+
// PipeBestEffort sets best-effort pipeline semantics (run all stages, surface the first error).
1313

1414
// Example: best effort
1515
res, err := execx.Command("false").

examples/pipestrict/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func main() {
12-
// PipeStrict sets strict pipeline semantics.
12+
// PipeStrict sets strict pipeline semantics (stop on first failure).
1313

1414
// Example: strict
1515
res, _ := execx.Command("false").

examples/setpgid/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func main() {
12-
// Setpgid is a no-op on Windows.
12+
// Setpgid sets the process group ID behavior.
1313

1414
// Example: setpgid
1515
fmt.Println(execx.Command("go", "env", "GOOS").Setpgid(true) != nil)

examples/setsid/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func main() {
12-
// Setsid is a no-op on Windows.
12+
// Setsid sets the session ID behavior.
1313

1414
// Example: setsid
1515
fmt.Println(execx.Command("go", "env", "GOOS").Setsid(true) != nil)

0 commit comments

Comments
 (0)