summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-10-23 23:07:30 +0800
committerruki <[email protected]>2020-10-23 23:07:30 +0800
commitbe9f77da1210535f8c92ca68d51af18fc1b1932f (patch)
tree7920082c6d8f20e70ea5d72bceaf5c698081a0d1
parentd1ecb3c26a99386fee1319d4f4f14dff423cc617 (diff)
add some options for xrepo/install
-rw-r--r--xmake/actions/require/xmake.lua2
-rw-r--r--xmake/core/sandbox/modules/import/core/base/option.lua4
-rw-r--r--xmake/modules/private/xrepo/action/install.lua12
-rw-r--r--xmake/modules/private/xrepo/main.lua19
4 files changed, 21 insertions, 16 deletions
diff --git a/xmake/actions/require/xmake.lua b/xmake/actions/require/xmake.lua
index 6e1a28ff9..faa380b48 100644
--- a/xmake/actions/require/xmake.lua
+++ b/xmake/actions/require/xmake.lua
@@ -46,7 +46,7 @@ task("require")
" $ xmake require --clean",
" $ xmake require --clean zlib tbox pcr*" }
, {'f', "force", "k", nil, "Force to reinstall all package dependencies." }
- , {nil, "shallow", "k", nil, "Only install the root packages." }
+ , {nil, "shallow", "k", nil, "Does not install dependent packages." }
, {'l', "list", "k", nil, "List all package dependencies in project.",
"e.g.",
" $ xmake require --list" }
diff --git a/xmake/core/sandbox/modules/import/core/base/option.lua b/xmake/core/sandbox/modules/import/core/base/option.lua
index 802007630..a5aa10fa3 100644
--- a/xmake/core/sandbox/modules/import/core/base/option.lua
+++ b/xmake/core/sandbox/modules/import/core/base/option.lua
@@ -62,8 +62,8 @@ function sandbox_core_base_option.show_logo(logo, opt)
end
-- show options
-function sandbox_core_base_option.show_options(options)
- option.show_options(options)
+function sandbox_core_base_option.show_options(options, taskname)
+ option.show_options(options, taskname)
end
-- parse arguments with the given options
diff --git a/xmake/modules/private/xrepo/action/install.lua b/xmake/modules/private/xrepo/action/install.lua
index 24cf57c92..26af8798e 100644
--- a/xmake/modules/private/xrepo/action/install.lua
+++ b/xmake/modules/private/xrepo/action/install.lua
@@ -30,8 +30,14 @@ function menu_options()
-- menu options
local options =
{
- {nil, "action", "v", nil, "The sub-command name." },
- {nil, "options", "vs", nil, "The sub-command options." }
+ {'k', "kind", "kv", nil, "Enable static/shared library.",
+ values = {"static", "shared"} },
+ {'p', "plat", "kv", nil, "Set the given platform." },
+ {'a', "arch", "kv", nil, "Set the given architecture." },
+ {'m', "mode", "kv", nil, "Set the given mode.",
+ values = {"release", "debug"} },
+ {},
+ {nil, "shallow", "k", nil, "Does not install dependent packages."}
}
-- show menu options
@@ -45,7 +51,7 @@ function menu_options()
print(description)
-- show options
- option.show_options(options)
+ option.show_options(options, "install")
end
return options, show_options, description
end
diff --git a/xmake/modules/private/xrepo/main.lua b/xmake/modules/private/xrepo/main.lua
index c9b1299e8..1a6d3fd6f 100644
--- a/xmake/modules/private/xrepo/main.lua
+++ b/xmake/modules/private/xrepo/main.lua
@@ -91,7 +91,7 @@ function _menu_options()
show_actions()
-- show options
- option.show_options(options)
+ option.show_options(options, "main")
end
return options, show_options
end
@@ -119,18 +119,17 @@ function _parse_options(...)
-- insert common options
local common_options =
{
- {},
- {'q', "quiet", "k", nil, "Quiet operation."},
- {'y', "yes", "k", nil, "Input yes by default if need user confirm."},
- {nil, "root", "k", nil, "Allow to run xrepo as root."},
+ {'q', "quiet", "k", nil, "Quiet operation." },
+ {'y', "yes", "k", nil, "Input yes by default if need user confirm." },
+ {nil, "root", "k", nil, "Allow to run xrepo as root." },
{},
{'v', "verbose", "k", nil, "Print lots of verbose information for users."},
- {'D', "diagnosis", "k", nil, "Print lots of diagnosis information."},
- {nil, "version", "k", nil, "Print the version number and exit."},
- {'h', "help", "k", nil, "Print this help message and exit."},
- {}
+ {'D', "diagnosis", "k", nil, "Print lots of diagnosis information." },
+ {nil, "version", "k", nil, "Print the version number and exit." },
+ {'h', "help", "k", nil, "Print this help message and exit." },
+ {category = action and "action" or nil},
}
- for _, opt in ipairs(common_options) do
+ for _, opt in irpairs(common_options) do
table.insert(options, 1, opt)
end