diff --git a/docs/changelog.txt b/docs/changelog.txt index 9b0a1d30e..b9ceb618a 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -64,6 +64,7 @@ Template for new versions: ## API ## Lua +- ``argparse.boolean``: convert arguments to lua boolean values. ## Removed diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index f6af309d4..a267545ca 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -3538,6 +3538,12 @@ parameters. ``tonumber(arg)``. If ``arg_name`` is specified, it is used to make error messages more useful. +* ``argparse.boolean(arg, arg_name)`` + Converts ``string.lower(arg)`` from "yes/no/on/off/true/false/etc..." to a lua + boolean. Throws if the value can't be converted, otherwise returns + ``true``/``false``. If ``arg_name`` is specified, it is used to make error + messages more useful. + dumper ======