Skip to content

Commit cf9252f

Browse files
committed
Correct redbean unix.commandv() docs
Fixes #1330
1 parent 5fae582 commit cf9252f

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

tool/net/definitions.lua

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

tool/net/help.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,11 +2877,13 @@ UNIX MODULE
28772877
unix.execve(prog, {prog, '-hal', '.'}, {'PATH=/bin'})
28782878
unix.exit(127)
28792879

2880-
We automatically suffix `.com` and `.exe` for all platforms when
2881-
path searching. By default, the current directory is not on the
2882-
path. If `prog` is an absolute path, then it's returned as-is. If
2883-
`prog` contains slashes then it's not path searched either and will
2884-
be returned if it exists.
2880+
If `prog` is an absolute path, then it's returned as-is. If `prog`
2881+
contains slashes then it's not path searched either and will be
2882+
returned if it exists. On Windows, it's recommended that you install
2883+
programs from cosmos to c:/bin/ without any .exe or .com suffix, so
2884+
they can be discovered like they would on UNIX. If you want to find
2885+
a program like notepad on the $PATH using this function, then you
2886+
need to specify "notepad.exe" so it includes the extension.
28852887

28862888
unix.execve(prog:str[, args:List<*>, env:List<*>])
28872889
└─→ nil, unix.Errno

0 commit comments

Comments
 (0)