Correct redbean unix.commandv() docs

Fixes #1330
This commit is contained in:
Justine Tunney 2024-11-29 12:14:28 -08:00
parent 5fae582e82
commit cf9252f429
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2 changed files with 15 additions and 10 deletions

View file

@ -5188,11 +5188,14 @@ function unix.fork() end
--- unix.execve(prog, {prog, '-hal', '.'}, {'PATH=/bin'}) --- unix.execve(prog, {prog, '-hal', '.'}, {'PATH=/bin'})
--- unix.exit(127) --- unix.exit(127)
--- ---
--- We automatically suffix `.com` and `.exe` for all platforms when --- If `prog` is an absolute path, then it's returned as-is. If `prog`
--- path searching. By default, the current directory is not on the --- contains slashes then it's not path searched either and will be
--- path. If `prog` is an absolute path, then it's returned as-is. If --- returned if it exists. On Windows, it's recommended that you install
--- `prog` contains slashes then it's not path searched either and will --- programs from cosmos to c:/bin/ without any .exe or .com suffix, so
--- be returned if it exists. --- they can be discovered like they would on UNIX. If you want to find
--- a program like notepad on the $PATH using this function, then you
--- need to specify "notepad.exe" so it includes the extension.
---
---@param prog string ---@param prog string
---@return string path ---@return string path
---@overload fun(prog: string): nil, error: unix.Errno ---@overload fun(prog: string): nil, error: unix.Errno

View file

@ -2877,11 +2877,13 @@ UNIX MODULE
unix.execve(prog, {prog, '-hal', '.'}, {'PATH=/bin'}) unix.execve(prog, {prog, '-hal', '.'}, {'PATH=/bin'})
unix.exit(127) unix.exit(127)
We automatically suffix `.com` and `.exe` for all platforms when If `prog` is an absolute path, then it's returned as-is. If `prog`
path searching. By default, the current directory is not on the contains slashes then it's not path searched either and will be
path. If `prog` is an absolute path, then it's returned as-is. If returned if it exists. On Windows, it's recommended that you install
`prog` contains slashes then it's not path searched either and will programs from cosmos to c:/bin/ without any .exe or .com suffix, so
be returned if it exists. they can be discovered like they would on UNIX. If you want to find
a program like notepad on the $PATH using this function, then you
need to specify "notepad.exe" so it includes the extension.
unix.execve(prog:str[, args:List<*>, env:List<*>]) unix.execve(prog:str[, args:List<*>, env:List<*>])
└─→ nil, unix.Errno └─→ nil, unix.Errno