Skip to content

Commit

Permalink
Feat: Add support for numbers in the command options
Browse files Browse the repository at this point in the history
  • Loading branch information
hankertrix committed Jul 9, 2024
1 parent 7ed3c61 commit b67ca84
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b67ca84

Please sign in to comment.