doc: fixes for spawn.with_line_callback

This commit is contained in:
Daniel Hahler 2015-12-26 18:45:34 +01:00
parent 5db280ab73
commit df21a85a9a
1 changed files with 16 additions and 14 deletions

View File

@ -129,20 +129,22 @@ 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
-- @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.