Document command_target

This commit is contained in:
mpeterv
2015-12-09 13:05:48 +03:00
parent 247ed9e874
commit 1fa69cbf30
2 changed files with 25 additions and 0 deletions

View File

@@ -35,6 +35,29 @@ A typo will result in an appropriate error message.
Error: unknown command 'instal'
Did you mean 'install'?
Getting name of selected command
--------------------------------
Use ``command_target`` property of the parser to store the name of used command in a field of the result table.
.. code-block:: lua
:linenos:
parser:command_target("command")
parser:command("install")
parser:command("remove")
::
$ lua script.lua install
.. code-block:: lua
{
install = true,
command = "install"
}
Adding elements to commands
---------------------------