From df21a85a9a01134db81838a5fe2659fc90bfec10 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 26 Dec 2015 18:45:34 +0100 Subject: [PATCH] doc: fixes for spawn.with_line_callback --- lib/awful/spawn.lua | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/awful/spawn.lua b/lib/awful/spawn.lua index 12fa498d8..e34998155 100644 --- a/lib/awful/spawn.lua +++ b/lib/awful/spawn.lua @@ -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)