Skip to content

Commit

Permalink
pkg/tool/exec: document how Run.cmd works with string versus list
Browse files Browse the repository at this point in the history
In particular, that the string form is only meant for basic use cases,
and the list form is necessary if any arguments must contain whitespace.

If users continue to get confused or bitten by its behavior,
we can later deprecate it in favor of the list form,
teaching `cue fix` to rewrite existing code.
For now, we continue to support the string form with the better docs,
as doing anything else right away seems a bit premature.

Fixes #3238.

Signed-off-by: Daniel Martí <[email protected]>
Change-Id: I8e85aa75658bc9577647d993f82a54dca844e46d
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1197453
Reviewed-by: Roger Peppe <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
mvdan committed Jul 9, 2024
1 parent f6be8a8 commit 7e1f140
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/tool/exec/exec.cue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Run: {
$id: *"tool/exec.Run" | "exec" // exec for backwards compatibility

// cmd is the command to run.
// Simple commands can use a string, which is split by white space characters.
// If any arguments include white space, use the list form.
cmd: string | [string, ...string]

// dir specifies the working directory of the command.
Expand Down
2 changes: 2 additions & 0 deletions pkg/tool/exec/pkg.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7e1f140

Please sign in to comment.