diff options
| author | ruki <[email protected]> | 2015-06-10 11:51:06 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-10 11:51:06 +0800 |
| commit | 21829afa8efa18ca57e4bd9b322c6be1f84d392d (patch) | |
| tree | e3af545e1c76f83824fbd63f8f0043363252cd9f /xmake/scripts/base/option.lua | |
| parent | 177400e62e74d5ad3539573cfd3143cd19d3d30f (diff) | |
fix merge option and config for boolean value
Diffstat (limited to 'xmake/scripts/base/option.lua')
| -rw-r--r-- | xmake/scripts/base/option.lua | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/xmake/scripts/base/option.lua b/xmake/scripts/base/option.lua index a6e26907f..8ad3613c2 100644 --- a/xmake/scripts/base/option.lua +++ b/xmake/scripts/base/option.lua @@ -221,6 +221,13 @@ function option.init(argv, menu) return false end + -- value is "true" or "false", translate it + if type(value) == "string" then + if value == "true" then value = true + elseif value == "false" then value = false + end + end + -- save option xmake._OPTIONS[utils.ifelse(prefix == 1 and opt[2], opt[2], key)] = value @@ -626,15 +633,15 @@ function option.print_options(options) end -- append the option description - local description = option[5]; + local description = option[5] if description then option_info = option_info .. description end -- append the default value - local default = option[4]; + local default = option[4] if default then - option_info = option_info .. " (default: " .. default .. ")" + option_info = option_info .. " (default: " .. tostring(default) .. ")" end -- print option info |
