diff options
| author | ruki <[email protected]> | 2020-11-14 10:04:33 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-11-14 10:04:33 +0800 |
| commit | f319e8d4c69513dbbf07e6737b4ba03c2cb88524 (patch) | |
| tree | ccd82afaf653a85fbf55f5e3aee159577aa856a7 | |
| parent | 312521468d7fb068d7527a2efb33335073bfea0b (diff) | |
| parent | 0f1ab80c1f613c768c70cbb782db0962a8153765 (diff) | |
Merge pull request #1033 from jonathanpoelen/optdefault
fix default value of choice options displayed in the graphical menu
| -rw-r--r-- | xmake/core/ui/mconfdialog.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/core/ui/mconfdialog.lua b/xmake/core/ui/mconfdialog.lua index e52f87e46..d430e4a18 100644 --- a/xmake/core/ui/mconfdialog.lua +++ b/xmake/core/ui/mconfdialog.lua @@ -252,14 +252,16 @@ function mconfdialog:show_help() if config.kind then text = text .. "\ntype: " .. config.kind end - if config.default then - text = text .. "\ndefault: " .. tostring(config.default) - end if config.kind == "choice" then + if config.default and config.values[config.default] then + text = text .. "\ndefault: " .. config.values[config.default] + end text = text .. "\nvalues: " for _, value in ipairs(config.values) do text = text .. "\n - " .. value end + elseif config.default then + text = text .. "\ndefault: " .. tostring(config.default) end if config.path then text = text .. "\npath: " .. config.path |
