aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-07-14 23:18:40 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2020-07-14 23:18:40 -0400
commitec96c0bed0fdb3df98c88fc6d559fa4e483fb912 (patch)
tree7400ff98682e455158e794be5ced535f0f321e59
parentf876b491aed01150ff090048e3dca4f3eb8c76f4 (diff)
downloadtextadept-ec96c0bed0fdb3df98c88fc6d559fa4e483fb912.tar.gz
textadept-ec96c0bed0fdb3df98c88fc6d559fa4e483fb912.zip
Renamed os.spawn() parameter from 'argv' to 'cmd'.
There should be no confusion that it's a command line string, not a table of strings.
-rw-r--r--core/.os.luadoc8
-rw-r--r--core/init.lua4
2 files changed, 6 insertions, 6 deletions
diff --git a/core/.os.luadoc b/core/.os.luadoc
index 69132e6f..1908c200 100644
--- a/core/.os.luadoc
+++ b/core/.os.luadoc
@@ -6,13 +6,13 @@
module('os')
---
--- Spawns an interactive child process *argv* in a separate thread, returning
+-- Spawns an interactive child process *cmd* in a separate thread, returning
-- a handle to that process.
--- On Windows, *argv* is passed to `cmd.exe`: `%COMSPEC% /c [argv]`.
+-- On Windows, *cmd* is passed to `cmd.exe`: `%COMSPEC% /c [cmd]`.
-- At the moment, only the Windows terminal version spawns processes in the same
-- thread.
--- @param argv A command line string that contains the program's name followed
--- by arguments to pass to it. `PATH` is searched for program names.
+-- @param cmd A command line string that contains the program's name followed by
+-- arguments to pass to it. `PATH` is searched for program names.
-- @param cwd Optional current working directory (cwd) for the child
-- process. When omitted, the parent's cwd is used.
-- @param env Optional list of environment variables for the child process.
diff --git a/core/init.lua b/core/init.lua
index 07c9e060..32e4090a 100644
--- a/core/init.lua
+++ b/core/init.lua
@@ -23,7 +23,7 @@ _M = {} -- language modules table
-- pdcurses compatibility.
if CURSES and WIN32 then
- function os.spawn(argv, ...)
+ function os.spawn(cmd, ...)
local cwd = lfs.currentdir()
local args, i = {...}, 1
if type(args[i]) == 'string' then
@@ -31,7 +31,7 @@ if CURSES and WIN32 then
i = i + 1
end
if type(args[i]) == 'table' then i = i + 1 end -- env (ignore)
- local p = io.popen(assert_type(argv, 'string', 1) .. ' 2>&1')
+ local p = io.popen(assert_type(cmd, 'string', 1) .. ' 2>&1')
if type(args[i]) == 'function' then args[i](p:read('a')) end -- stdout_cb
local status = select(3, p:close())
if type(args[i + 2]) == 'function' then args[i + 2](status) end -- exit_cb