diff options
| author | ruki <[email protected]> | 2016-06-17 11:52:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-06-17 11:52:38 +0800 |
| commit | 44a93238e12d1a8ca5dd732afb2513d823f7c9b8 (patch) | |
| tree | f9ac097dd9c145cbb1450cdf4166e6512462ae6a | |
| parent | 72b64ee532c8de65d177e387087fb14ab9ee478f (diff) | |
fix option parser bug
| -rw-r--r-- | xmake/core/base/option.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/core/base/option.lua b/xmake/core/base/option.lua index 353d1e837..df021f63b 100644 --- a/xmake/core/base/option.lua +++ b/xmake/core/base/option.lua @@ -204,7 +204,7 @@ function option.init(menu) -- parse key and value local key, value local i = arg:find("=", 1, true) - + -- key=value? if i and not argkv_end then key = arg:sub(1, i - 1) @@ -294,7 +294,7 @@ function option.init(menu) -- exists value? _k = idx - if idx == nil or arg:startswith("-") then + if idx == nil or (arg:startswith("-") and not arg:find("%s")) then -- print menu option.show_menu(context.taskname) @@ -601,7 +601,7 @@ function option.parse(argv, options) -- exists value? _k = idx - if idx == nil or arg:startswith("-") then + if idx == nil or (arg:startswith("-") and not arg:find("%s")) then -- failed return nil, "invalid option: " .. option._ifelse(idx, arg, key) |
