1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-28 02:19:04 +00:00

Adds support for passing arguments without the script name.

This commit is contained in:
paulino
2011-07-27 04:32:01 +00:00
parent 26dc09ad43
commit ec63b8a647

View File

@@ -610,7 +610,16 @@ end
local function arg_value(argname)
if nmap.registry.args[argname] then
return nmap.registry.args[argname]
else
-- if scriptname.arg is not there, check "arg"
local argument_frags = strsplit("%.", argname)
if #argument_frags > 0 then
if nmap.registry.args[argument_frags[2]] then
return nmap.registry.args[argument_frags[2]]
end
end
end
for _, v in ipairs(nmap.registry.args) do
if v == argname then
return 1