From 652349c7e7615aa7c6e6e9473e61dcfbef49d785 Mon Sep 17 00:00:00 2001 From: Andriel Chaoti <3628387+AndrielChaoti@users.noreply.github.com> Date: Sat, 9 Sep 2023 14:30:20 -0600 Subject: [PATCH] add docs for argparse.boolean added entry to changelog as well. --- docs/changelog.txt | 1 + docs/dev/Lua API.rst | 6 ++++++ 2 files changed, 7 insertions(+) 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 ======