summaryrefslogtreecommitdiff
path: root/xmake/core/base/task.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-07-17 22:22:55 +0800
committerruki <[email protected]>2019-07-17 08:17:35 +0800
commit54386754982c5580e9d351484eabd45ebfd20c48 (patch)
treed1ab3c948f9cdad3c4e63baf8479cc6cefb7b177 /xmake/core/base/task.lua
parentb79aa8f838f8140b2512d65afc98ad7fca62a91f (diff)
fix dup build help
Diffstat (limited to 'xmake/core/base/task.lua')
-rw-r--r--xmake/core/base/task.lua50
1 files changed, 26 insertions, 24 deletions
diff --git a/xmake/core/base/task.lua b/xmake/core/base/task.lua
index d83983c8b..82ac2bea2 100644
--- a/xmake/core/base/task.lua
+++ b/xmake/core/base/task.lua
@@ -125,30 +125,32 @@ function task._translate_menu(menu)
end
end
- -- add common options
- table.insert(options, 1, {'q', "quiet", "k", nil, "Quiet operation." })
- table.insert(options, 2, {'y', "yes", "k", nil, "Input yes by default if need user confirm." })
- table.insert(options, 3, {nil, "confirm", "kv", nil, "Input the given result if need user confirm.",
- " - y|yes",
- " - n|no",
- " - d|def"})
- table.insert(options, 4, {'v', "verbose", "k", nil, "Print lots of verbose information for users." })
- table.insert(options, 5, {nil, "root", "k", nil, "Allow to run xmake as root." })
- table.insert(options, 6, {'D', "diagnosis", "k", nil, "Print lots of diagnosis information (backtrace, check info ..) only for developers."
- , "And we can append -v to get more whole information."
- , " e.g. $ xmake -v -D"})
- table.insert(options, 7, {nil, "profile", "k", nil, "Print performance data only for developers." })
- table.insert(options, 8, {nil, "version", "k", nil, "Print the version number and exit." })
- table.insert(options, 9, {'h', "help", "k", nil, "Print this help message and exit." })
- table.insert(options, 10, {})
- table.insert(options, 11, {'F', "file", "kv", nil, "Read a given xmake.lua file." })
- table.insert(options, 12, {'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, 13, {})
-
+ -- add common options, we need avoid repeat because the main/build task will be inserted twice
+ if not menu._common_options then
+ table.insert(options, 1, {'q', "quiet", "k", nil, "Quiet operation." })
+ table.insert(options, 2, {'y', "yes", "k", nil, "Input yes by default if need user confirm." })
+ table.insert(options, 3, {nil, "confirm", "kv", nil, "Input the given result if need user confirm.",
+ " - y|yes",
+ " - n|no",
+ " - d|def"})
+ table.insert(options, 4, {'v', "verbose", "k", nil, "Print lots of verbose information for users." })
+ table.insert(options, 5, {nil, "root", "k", nil, "Allow to run xmake as root." })
+ table.insert(options, 6, {'D', "diagnosis", "k", nil, "Print lots of diagnosis information (backtrace, check info ..) only for developers."
+ , "And we can append -v to get more whole information."
+ , " e.g. $ xmake -v -D"})
+ table.insert(options, 7, {nil, "profile", "k", nil, "Print performance data only for developers." })
+ table.insert(options, 8, {nil, "version", "k", nil, "Print the version number and exit." })
+ table.insert(options, 9, {'h', "help", "k", nil, "Print this help message and exit." })
+ table.insert(options, 10, {})
+ table.insert(options, 11, {'F', "file", "kv", nil, "Read a given xmake.lua file." })
+ table.insert(options, 12, {'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, 13, {})
+ menu._common_options = true
+ end
end
-- ok