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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user