From cf9252f4298c247095a600a47d6d83c58f15dbb3 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Fri, 29 Nov 2024 12:14:28 -0800 Subject: [PATCH] Correct redbean unix.commandv() docs Fixes #1330 --- tool/net/definitions.lua | 13 ++++++++----- tool/net/help.txt | 12 +++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/tool/net/definitions.lua b/tool/net/definitions.lua index 7bc2191772a..3732416b017 100644 --- a/tool/net/definitions.lua +++ b/tool/net/definitions.lua @@ -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 diff --git a/tool/net/help.txt b/tool/net/help.txt index 5c722e294e0..5703d64b917 100644 --- a/tool/net/help.txt +++ b/tool/net/help.txt @@ -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