Skip to content

Commit

Permalink
macro: pass positional arguments to script
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Mar 7, 2024
1 parent 76c9a66 commit 7771409
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ func shell(shell, command string) carapace.Action {
return carapace.ActionMessage("unsupported shell [%v]: %v", runtime.GOOS, shell)
}

return carapace.ActionExecCommand(shell, "-c", command)(func(output []byte) carapace.Action {
args := append([]string{"-c", command, "--"}, c.Args...)
return carapace.ActionExecCommand(shell, args...)(func(output []byte) carapace.Action {
lines := strings.Split(string(output), "\n")
batch := carapace.Batch()
for _, line := range lines {
Expand Down

0 comments on commit 7771409

Please sign in to comment.