doc: Better document the prompt hooks

This commit is contained in:
Emmanuel Lepage Vallee 2016-12-30 15:20:21 -05:00
parent a6161d1229
commit 1c4b991e33
1 changed files with 18 additions and 0 deletions

View File

@ -353,6 +353,24 @@ end
-- @tparam string before_cursor
-- @tparam string after_cursor
--- A callback when a key combination is triggered.
-- This callback can return many things:
--
-- * a modified command
-- * `true` If the command is successful (then it won't exit)
-- * nothing or `nil` to execute the `exe_callback` and `done_callback` and exit
--
-- An optional second return value controls if the prompt should exit or simply
-- update the command (from the first return value) and keep going. The default
-- is to execute the `exe_callback` and `done_callback` before exiting.
--
-- @usage local function my_hook(command)
-- return command.."foo", false
-- end
--
-- @callback hook
-- @tparam string command The current command.
--- Run a prompt in a box.
--
-- @tparam[opt={}] table args A table with optional arguments