diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-25 19:23:05 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-26 10:13:02 -0300 |
commit | 0e04e372cb118ca997f7ede59041df934cd939f1 (patch) | |
tree | cad63d0a38c1d3665b458707f630260ac908dcf7 /src | |
parent | 842d7342eb12d133fa85514d801983095300e76c (diff) | |
download | luarocks-0e04e372cb118ca997f7ede59041df934cd939f1.tar.gz luarocks-0e04e372cb118ca997f7ede59041df934cd939f1.tar.bz2 luarocks-0e04e372cb118ca997f7ede59041df934cd939f1.zip |
cmd: do not parse assignments after --
This allows using assignments with Busted in `luarocks test`.
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/cmd.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/luarocks/cmd.lua b/src/luarocks/cmd.lua index 1a4cd0e1..2c5a3655 100644 --- a/src/luarocks/cmd.lua +++ b/src/luarocks/cmd.lua | |||
@@ -302,7 +302,14 @@ function cmd.run_command(description, commands, external_namespace, ...) | |||
302 | local function process_arguments(...) | 302 | local function process_arguments(...) |
303 | local args = {...} | 303 | local args = {...} |
304 | local cmdline_vars = {} | 304 | local cmdline_vars = {} |
305 | for i = #args, 1, -1 do | 305 | local last = #args |
306 | for i = 1, #args do | ||
307 | if args[i] == "--" then | ||
308 | last = i - 1 | ||
309 | break | ||
310 | end | ||
311 | end | ||
312 | for i = last, 1, -1 do | ||
306 | local arg = args[i] | 313 | local arg = args[i] |
307 | if arg:match("^[^-][^=]*=") then | 314 | if arg:match("^[^-][^=]*=") then |
308 | local var, val = arg:match("^([A-Z_][A-Z0-9_]*)=(.*)") | 315 | local var, val = arg:match("^([A-Z_][A-Z0-9_]*)=(.*)") |