doc: fixes for spawn.with_line_callback
This commit is contained in:
parent
5db280ab73
commit
df21a85a9a
|
@ -129,21 +129,23 @@ function spawn.with_shell(cmd)
|
|||
end
|
||||
end
|
||||
|
||||
--- Spawn a program and asynchronously and capture its output line by line.
|
||||
--- Spawn a program and asynchronously capture its output line by line.
|
||||
-- @tparam string|table cmd The command.
|
||||
-- @tab callbacks Table containing callbacks that should be
|
||||
-- invoked on various conditions.
|
||||
-- @tparam[opt] function callbacks.stdout Function that is called with each line of
|
||||
-- output on stdout, e.g. `stdout(line)`.
|
||||
-- @tparam[opt] function callbacks.stderr Function that is called with each line of
|
||||
-- output on stderr, e.g. `stderr(line)`.
|
||||
-- @tparam[opt] function callbacks.output_done Function to call when no more output
|
||||
-- is produced.
|
||||
-- @tparam[opt] function callbacks.exit Function to call when the spawned process
|
||||
-- exits. This function gets the exit reason and code as its argument. The
|
||||
-- reason can be "exit" or "signal". For "exit", the second argument is the exit
|
||||
-- code. For "signal", the second argument is the signal causing process
|
||||
-- termination.
|
||||
-- @tab callbacks Table containing callbacks that should be invoked on
|
||||
-- various conditions.
|
||||
-- @tparam[opt] function callbacks.stdout Function that is called with each
|
||||
-- line of output on stdout, e.g. `stdout(line)`.
|
||||
-- @tparam[opt] function callbacks.stderr Function that is called with each
|
||||
-- line of output on stderr, e.g. `stderr(line)`.
|
||||
-- @tparam[opt] function callbacks.output_done Function to call when no more
|
||||
-- output is produced.
|
||||
-- @tparam[opt] function callbacks.exit Function to call when the spawned
|
||||
-- process exits. This function gets the exit reason and code as its
|
||||
-- arguments.
|
||||
-- The reason can be "exit" or "signal".
|
||||
-- For "exit", the second argument is the exit code.
|
||||
-- For "signal", the second argument is the signal causing process
|
||||
-- termination.
|
||||
-- @treturn[1] Integer the PID of the forked process.
|
||||
-- @treturn[2] string Error message.
|
||||
function spawn.with_line_callback(cmd, callbacks)
|
||||
|
|
Loading…
Reference in New Issue