diff --git a/lua/telescope/command.lua b/lua/telescope/command.lua index da67c8b..b94067c 100644 --- a/lua/telescope/command.lua +++ b/lua/telescope/command.lua @@ -4,6 +4,11 @@ local extensions = require('telescope._extensions').manager local config = require('telescope.config') local command = {} +local bool_type = { + ['false'] = false, + ['true'] = true +} + -- convert command line string arguments to -- lua number boolean type and nil value local function convert_user_opts(user_opts) @@ -29,6 +34,9 @@ local function convert_user_opts(user_opts) if val == '"' then user_opts[key] = '' end + if bool_type[val] ~= nil then + user_opts[key] = bool_type[val] + end end } @@ -41,8 +49,10 @@ local function convert_user_opts(user_opts) setmetatable(_switch,_switch_metatable) for key,val in pairs(user_opts) do - if default_opts[key] ~= nil then + if default_opts[key] ~= nil then _switch[type(default_opts[key])](key,val) + else + _switch['string'](key,val) end end end