From b67ca84be611b65f0d726e5dc6a4edded0075d84 Mon Sep 17 00:00:00 2001 From: hankertrix <91734413+hankertrix@users.noreply.github.com> Date: Tue, 9 Jul 2024 10:30:31 +0800 Subject: [PATCH] Feat: Add support for numbers in the command options --- init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/init.lua b/init.lua index 84dfdb7..2a22d82 100644 --- a/init.lua +++ b/init.lua @@ -208,6 +208,16 @@ local function parse_args(args) -- Set the argument value to true arg_value = true + + -- Otherwise + else + + -- Try to convert the argument value to a number + local number_arg_value = tonumber(arg_value) + + -- Set the argument value to the number + -- if the the argument value can be converted to a number + arg_value = number_arg_value and number_arg_value or arg_value end -- Add the argument name and value to the options