processArgs now detects duplicate args.

develop
expwnent 2014-07-01 00:57:24 -04:00
parent 2ed7960f96
commit 1c0ae94539
1 changed files with 3 additions and 0 deletions

@ -594,6 +594,9 @@ function processArgs(args, validArgs)
if validArgs and not validArgs[argName] then if validArgs and not validArgs[argName] then
error('error: invalid arg: ' .. i .. ': ' .. argName) error('error: invalid arg: ' .. i .. ': ' .. argName)
end end
if result[argName] then
error('duplicate arg: ' .. i .. ': ' .. argName)
end
if i+1 > #args or string.sub(args[i+1],1,1) == '-' then if i+1 > #args or string.sub(args[i+1],1,1) == '-' then
result[argName] = '' result[argName] = ''
argName = nil argName = nil