From bebd56cac83c219872dc72615e3ad616c2658622 Mon Sep 17 00:00:00 2001 From: mpeterv Date: Wed, 9 Dec 2015 14:03:35 +0300 Subject: [PATCH] Document command action second argument --- docsrc/callbacks.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docsrc/callbacks.rst b/docsrc/callbacks.rst index 0a5c8c5..9b37984 100644 --- a/docsrc/callbacks.rst +++ b/docsrc/callbacks.rst @@ -232,13 +232,13 @@ Examples using ``store_false`` and ``concat`` actions: Command actions ^^^^^^^^^^^^^^^ -Actions for parsers and commands are simply callbacks invoked after parsing, with the argument table as the only argument. Actions for nested commands are called first. +Actions for parsers and commands are simply callbacks invoked after parsing, with result table and command name as the arguments. Actions for nested commands are called first. .. code-block:: lua :linenos: - local install = parser:command("install"):action(function(args) - print("Running install...") + local install = parser:command("install"):action(function(args, name) + print("Running " .. name) -- Use args here ) @@ -252,5 +252,5 @@ Actions for parsers and commands are simply callbacks invoked after parsing, wit :: - Running install... + Running install Callbacks are fun!