Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Correct uv.spawn options.args docs about the first argument #674

Merged
merged 1 commit into from
Sep 2, 2023

Conversation

squeek502
Copy link
Member

@squeek502 squeek502 commented Sep 2, 2023

This was left over from the libuv docs, but the luv bindings handle this differently and options.args should only include the command arguments, not the command name itself.

See #673 (comment)

Example from our tests:

if isWindows then
cmd = "cmd.exe"
args = {"/c", "echo "..input}
expectedOutput = input .. "\r\n"
else
cmd = "echo"
args = {input}
expectedOutput = input .. "\n"
end
local handle, pid
handle, pid = uv.spawn(cmd, {
args = args,
stdio = {nil, stdout},
}, expect(function (code, signal)
p("exit", {code=code, signal=signal})
uv.close(handle)
end))

This was left over from the libuv docs, but the luv bindings handle this differently and `options.args` should *only* include the command arguments, not the command name itself.
errors. (See `options.verbatim` below for Windows.)
- `options.args` - Command line arguments as a list of strings. The first
string should *not* be the path to the program, since that is already
provided via `path`. On Windows, this uses CreateProcess which concatenates
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provided via path by luv, this is slightly different with libuv.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's okay to leave this out because these are the luv docs, so it should be implied.

@squeek502 squeek502 merged commit 045bf29 into luvit:master Sep 2, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants