diff options
| author | ruki <[email protected]> | 2017-05-21 21:01:04 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-05-21 21:01:33 +0800 |
| commit | 57a8a73b96549260dd76109a77f0f0f6bb704de8 (patch) | |
| tree | 9d0a3233a1a43862da048bbcfe5e21573c9d7467 | |
| parent | 573618951446177bb2378f5852466e15153366e8 (diff) | |
add root common option
| -rw-r--r-- | xmake/actions/config/main.lua | 1 | ||||
| -rw-r--r-- | xmake/core/project/task.lua | 23 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/project/task.lua | 2 | ||||
| -rw-r--r-- | xmake/plugins/lua/xmake.lua | 1 |
4 files changed, 14 insertions, 13 deletions
diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua index ae250232f..0900aecb9 100644 --- a/xmake/actions/config/main.lua +++ b/xmake/actions/config/main.lua @@ -39,6 +39,7 @@ function _option_filter(name) { target = true , file = true + , root = true , quiet = true , profile = true , project = true diff --git a/xmake/core/project/task.lua b/xmake/core/project/task.lua index 35c051ef9..a237c1dc6 100644 --- a/xmake/core/project/task.lua +++ b/xmake/core/project/task.lua @@ -132,20 +132,21 @@ function task._translate_menu(menu) end -- add common options - table.insert(options, 1, {'q', "quiet", "k", nil, "Quiet operation." }) - table.insert(options, 2, {'v', "verbose", "k", nil, "Print lots of verbose information." }) - table.insert(options, 3, {nil, "backtrace", "k", nil, "Print backtrace information for debugging." }) - table.insert(options, 4, {nil, "profile", "k", nil, "Print performance data for debugging." }) - table.insert(options, 5, {nil, "version", "k", nil, "Print the version number and exit." }) - table.insert(options, 6, {'h', "help", "k", nil, "Print this help message and exit." }) - table.insert(options, 7, {}) - table.insert(options, 8, {'F', "file", "kv", nil, "Read a given xmake.lua file." }) - table.insert(options, 9, {'P', "project", "kv", nil, "Change to the given project directory." + table.insert(options, 1, {'q', "quiet", "k", nil, "Quiet operation." }) + table.insert(options, 2, {'v', "verbose", "k", nil, "Print lots of verbose information." }) + table.insert(options, 3, {nil, "root", "k", nil, "Allow to run xmake as root." }) + table.insert(options, 4, {nil, "backtrace", "k", nil, "Print backtrace information for debugging." }) + table.insert(options, 5, {nil, "profile", "k", nil, "Print performance data for debugging." }) + table.insert(options, 6, {nil, "version", "k", nil, "Print the version number and exit." }) + table.insert(options, 7, {'h', "help", "k", nil, "Print this help message and exit." }) + table.insert(options, 8, {}) + table.insert(options, 9, {'F', "file", "kv", nil, "Read a given xmake.lua file." }) + table.insert(options, 10, {'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, 10, {}) + , " 3. The Current Directory" }) + table.insert(options, 11, {}) end diff --git a/xmake/core/sandbox/modules/import/core/project/task.lua b/xmake/core/sandbox/modules/import/core/project/task.lua index c5e098ec4..7098df4d3 100644 --- a/xmake/core/sandbox/modules/import/core/project/task.lua +++ b/xmake/core/sandbox/modules/import/core/project/task.lua @@ -41,7 +41,7 @@ function sandbox_core_project_task.run(taskname, options, ...) options = table.wrap(options) -- inherit some parent options - for _, name in ipairs({"file", "project", "backtrace", "verbose", "quiet"}) do + for _, name in ipairs({"file", "project", "backtrace", "verbose", "quiet", "root", "profile"}) do if not options[name] and option.get(name) then options[name] = option.get(name) end diff --git a/xmake/plugins/lua/xmake.lua b/xmake/plugins/lua/xmake.lua index 78cd176ab..073d94875 100644 --- a/xmake/plugins/lua/xmake.lua +++ b/xmake/plugins/lua/xmake.lua @@ -93,7 +93,6 @@ task("lua") { {'l', "list", "k", nil, "List all scripts." } - , {nil, "root", "k", nil, "Allow to run script as root." } , {'c', "command", "k", nil, "Run script as command" } , {nil, "script", "v", nil, "Run the given lua script name, file or module and enter interactive mode if no given script.", ".e.g", |
