From 00958c7b39c53a7e597ff6705ae9b1e2baeece4b Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 24 Feb 2016 16:55:27 +0800 Subject: add some common options --- xmake/core/base/task.lua | 9 +++++++++ xmake/core/tasks/build.lua | 5 +---- xmake/core/tasks/config.lua | 5 ----- xmake/core/tasks/lua.lua | 5 ----- xmake/plugins/doxygen.lua | 5 ----- 5 files changed, 10 insertions(+), 19 deletions(-) diff --git a/xmake/core/base/task.lua b/xmake/core/base/task.lua index 333f58edc..0237d62ee 100644 --- a/xmake/core/base/task.lua +++ b/xmake/core/base/task.lua @@ -137,6 +137,15 @@ function task.menu() -- has menu? if taskinfo.menu then + -- add common options + local options = taskinfo.menu.options + if options then + table.insert(options, 1, {'v', "verbose", "k", nil, "Print lots of verbose information." }) + 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, {}) + end + -- main? if taskinfo.category == "main" then menu.main = taskinfo.menu diff --git a/xmake/core/tasks/build.lua b/xmake/core/tasks/build.lua index 43ea3f7e8..7c18028d3 100755 --- a/xmake/core/tasks/build.lua +++ b/xmake/core/tasks/build.lua @@ -33,10 +33,7 @@ task("build") , {} , {'j', "jobs", "kv", nil, "Specifies the number of jobs to build simultaneously" } - , {'v', "verbose", "k", nil, "Print lots of verbose information." } - , {nil, "version", "k", nil, "Print the version number and exit." } - , {'h', "help", "k", nil, "Print this help message and exit." } - + , {} , {nil, "target", "v", "all", "Build the given target." } } diff --git a/xmake/core/tasks/config.lua b/xmake/core/tasks/config.lua index add0a3c59..6921c1c81 100755 --- a/xmake/core/tasks/config.lua +++ b/xmake/core/tasks/config.lua @@ -113,11 +113,6 @@ task("config") , {'o', "buildir", "kv", "build", "Set the build directory." } - , {} - , {'v', "verbose", "k", nil, "Print lots of verbose information." } - , {nil, "version", "k", nil, "Print the version number and exit." } - , {'h', "help", "k", nil, "Print this help message and exit." } - , {} , {nil, "target", "v", "all", "Configure for the given target." } } diff --git a/xmake/core/tasks/lua.lua b/xmake/core/tasks/lua.lua index 8258e5033..22aac6eea 100755 --- a/xmake/core/tasks/lua.lua +++ b/xmake/core/tasks/lua.lua @@ -28,11 +28,6 @@ task("lua") , {} , {'s', "string", "k", nil, "Run the lua string script." } - , {} - , {'v', "verbose", "k", nil, "Print lots of verbose information." } - , {nil, "version", "k", nil, "Print the version number and exit." } - , {'h', "help", "k", nil, "Print this help message and exit." } - , {} , {nil, "script", "v", nil, "Run the given lua script." , " - The script name from the xmake tool directory" diff --git a/xmake/plugins/doxygen.lua b/xmake/plugins/doxygen.lua index 14e4a9b14..2388efbd8 100755 --- a/xmake/plugins/doxygen.lua +++ b/xmake/plugins/doxygen.lua @@ -22,11 +22,6 @@ task("doxygen") , " 2. The Envirnoment Variable: XMAKE_PROJECT_DIR" , " 3. The Current Directory" } - , {} - , {'v', "verbose", "k", nil, "Print lots of verbose information." } - , {nil, "version", "k", nil, "Print the version number and exit." } - , {'h', "help", "k", nil, "Print this help message and exit." } - , {} , {nil, "name", "v", "all", "Configure for the given document name." } -- cgit v1.3.1