Skip to content

Commit

Permalink
fix: boolean options handling
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Apr 3, 2024
1 parent caab45c commit e76bf9f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/charm-freeze/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ M.get_arguments = function(args, options)
table.insert(cmd, "--" .. k .. "." .. string.gsub(_k, "_", "-"))
table.insert(cmd, _v)
end
-- handle boolean options, they are just flags with no value
elseif type(v) == "boolean" then
if v then
table.insert(cmd, "--" .. string.gsub(k, "_", "-"))
end
-- handle anything that is not the command or language option
elseif k ~= "command" and k ~= "language" then
table.insert(cmd, "--" .. string.gsub(k, "_", "-"))
Expand Down

0 comments on commit e76bf9f

Please sign in to comment.