Skip to content

Commit 1e65cee

Browse files
committed
pkg/tool/exec: Run does not exececute shell commands
It has always been an abstraction over os/exec.Command, that is, directly calling a program with some arguments and not a shell. The top-level godoc was misleading users into thinking they could use shell syntax like pipes or redirections. While here, make the cmd docs a bit clearer as well. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I8daa362deac7cb5380f39511f60908c9f13627b9 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200524 Reviewed-by: Matthew Sackman <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent 1440b9e commit 1e65cee

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

pkg/tool/exec/exec.cue

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414

1515
package exec
1616

17-
// Run executes the given shell command.
17+
// Run executes a program with the given arguments.
1818
Run: {
1919
$id: *"tool/exec.Run" | "exec" // exec for backwards compatibility
2020

21-
// cmd is the command to run.
21+
// cmd is a non-empty list holding the program name to run
22+
// and the arguments to be passed to it.
23+
//
2224
// Simple commands can use a string, which is split by white space characters.
23-
// If any arguments include white space, use the list form.
25+
// If any arguments include white space, or for clarity, use the list form.
2426
cmd: string | [string, ...string]
2527

2628
// dir specifies the working directory of the command.

pkg/tool/exec/pkg.go

+5-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)