Skip to content

Commit

Permalink
Correct redbean unix.commandv() docs
Browse files Browse the repository at this point in the history
Fixes #1330
  • Loading branch information
jart committed Nov 29, 2024
1 parent 5fae582 commit cf9252f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
13 changes: 8 additions & 5 deletions tool/net/definitions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5188,11 +5188,14 @@ function unix.fork() end
--- unix.execve(prog, {prog, '-hal', '.'}, {'PATH=/bin'})
--- unix.exit(127)
---
--- We automatically suffix `.com` and `.exe` for all platforms when
--- path searching. By default, the current directory is not on the
--- path. If `prog` is an absolute path, then it's returned as-is. If
--- `prog` contains slashes then it's not path searched either and will
--- be returned if it exists.
--- If `prog` is an absolute path, then it's returned as-is. If `prog`
--- contains slashes then it's not path searched either and will be
--- returned if it exists. On Windows, it's recommended that you install
--- programs from cosmos to c:/bin/ without any .exe or .com suffix, so
--- 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
---@return string path
---@overload fun(prog: string): nil, error: unix.Errno
Expand Down
12 changes: 7 additions & 5 deletions tool/net/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2877,11 +2877,13 @@ UNIX MODULE
unix.execve(prog, {prog, '-hal', '.'}, {'PATH=/bin'})
unix.exit(127)

We automatically suffix `.com` and `.exe` for all platforms when
path searching. By default, the current directory is not on the
path. If `prog` is an absolute path, then it's returned as-is. If
`prog` contains slashes then it's not path searched either and will
be returned if it exists.
If `prog` is an absolute path, then it's returned as-is. If `prog`
contains slashes then it's not path searched either and will be
returned if it exists. On Windows, it's recommended that you install
programs from cosmos to c:/bin/ without any .exe or .com suffix, so
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<*>])
└─→ nil, unix.Errno
Expand Down

0 comments on commit cf9252f

Please sign in to comment.