summaryrefslogtreecommitdiff
path: root/xmake/core/base/cli.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-01-07 00:50:41 +0800
committerruki <[email protected]>2025-01-07 00:50:41 +0800
commit61812aa80ba743e735368a52aec1c4c5bc4a7f5e (patch)
treeb4382b28aad29267fdad55924e1e567076325d24 /xmake/core/base/cli.lua
parentae8a596c609e01b21caa5825f3fd2eec0bdb7507 (diff)
support for namespace options
Diffstat (limited to 'xmake/core/base/cli.lua')
-rw-r--r--xmake/core/base/cli.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/core/base/cli.lua b/xmake/core/base/cli.lua
index a5d3db9ba..9eb4dfb71 100644
--- a/xmake/core/base/cli.lua
+++ b/xmake/core/base/cli.lua
@@ -89,7 +89,11 @@ function cli.parsev(argv, flags)
table.insert(parsed, cli._make_segment("sep", "--", argv, index, {}))
elseif value:startswith("--") then
-- "--key:value", "--key=value", "--long-flag"
- local sep = value:find("[=:]", 3, false)
+ local sep = value:find("[=]", 3, false)
+ -- ignore namespace, e.g. `--namespace::opt`
+ if sep and value:sub(sep, sep + 1) == "::" then
+ sep = nil
+ end
if sep then
table.insert(parsed, cli._make_option(value:sub(3, sep - 1), value:sub(sep + 1), false, argv, index))
else