diff options
| -rw-r--r-- | xmake/core/project/project.lua | 17 | ||||
| -rw-r--r-- | xmake/core/project/task.lua | 14 |
2 files changed, 22 insertions, 9 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index eb5e2f31f..c0d36b844 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -748,8 +748,21 @@ function project.menu() end -- append it - if opt:get("description") then - table.insert(menu, {nil, longname, "kv", default, opt:get("description")}) + local descriptions = opt:get("description") + if descriptions then + + -- define menu option + local menu_options = {nil, longname, "kv", default, descriptions} + + -- handle set_description("xx", "xx") + if type(descriptions) == "table" then + for i, description in ipairs(descriptions) do + menu_options[4 + i] = description + end + end + + -- insert option into menu + table.insert(menu, menu_options) else table.insert(menu, {nil, longname, "kv", default, nil}) end diff --git a/xmake/core/project/task.lua b/xmake/core/project/task.lua index b94685066..a0174e9e8 100644 --- a/xmake/core/project/task.lua +++ b/xmake/core/project/task.lua @@ -131,17 +131,17 @@ function task._translate_menu(menu) -- add common options table.insert(options, 1, {'v', "verbose", "k", nil, "Print lots of verbose information." }) - table.insert(options, 1, {nil, "backtrace", "k", nil, "Print backtrace information for debugging." }) - table.insert(options, 2, {nil, "version", "k", nil, "Print the version number and exit." }) - table.insert(options, 3, {'h', "help", "k", nil, "Print this help message and exit." }) - table.insert(options, 4, {}) - table.insert(options, 5, {'F', "file", "kv", nil, "Read a given xmake.lua file." }) - table.insert(options, 6, {'P', "project", "kv", nil, "Change to the given project directory." + table.insert(options, 2, {nil, "backtrace", "k", nil, "Print backtrace information for debugging." }) + table.insert(options, 3, {nil, "version", "k", nil, "Print the version number and exit." }) + table.insert(options, 4, {'h', "help", "k", nil, "Print this help message and exit." }) + table.insert(options, 5, {}) + table.insert(options, 6, {'F', "file", "kv", nil, "Read a given xmake.lua file." }) + table.insert(options, 7, {'P', "project", "kv", nil, "Change to the given project directory." , "Search priority:" , " 1. The Given Command Argument" , " 2. The Envirnoment Variable: XMAKE_PROJECT_DIR" , " 3. The Current Directory" }) - table.insert(options, 7, {}) + table.insert(options, 8, {}) end |
