1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-30 10:09:03 +00:00

Move comma-separated list code to outlib

This commit is contained in:
dmiller
2020-01-19 16:37:36 +00:00
parent 8e145819c2
commit 8df11582e6
6 changed files with 44 additions and 39 deletions

View File

@@ -1,5 +1,6 @@
local ipOps = require "ipOps"
local nmap = require "nmap"
local outlib = require "outlib"
local stdnse = require "stdnse"
local table = require "table"
local tableaux = require "tableaux"
@@ -85,12 +86,6 @@ hostaction = function(host)
end
end
local commasep = {
__tostring = function (t)
return table.concat(t, ", ")
end
}
postaction = function()
local db = nmap.registry[SCRIPT_NAME]
if ( db == nil ) then
@@ -108,7 +103,7 @@ postaction = function()
local result_entries = ports[port]
ipOps.ip_sort(result_entries)
if mode == 'horizontal' then
setmetatable(result_entries, commasep)
outlib.list_sep(result_entries)
end
results[("%s/%s"):format(port, proto)] = result_entries
end