Nmap Development mailing list archives

Re: [NSE][RFC] format.lua library


From: David Fifield <david () bamsoftware com>
Date: Wed, 12 Sep 2012 18:21:20 -0700

On Wed, Aug 15, 2012 at 01:14:51PM -0500, Daniel Miller wrote:
List,

Since David merged the XML NSE output functionality, I am eager to
get started converting old scripts to the new format. To support
this, I'm proposing the attached library, which I've called "format"
for the moment.

The idea is that there should be a collection of standardized ways
of formatting output, to make it easy for script authors to take
advantage of the structured output and to promote consistency in the
Normal output. The functions I've put into the library to start are
mostly focused around the __tostring way of formatting output, since
the simple "return a table and a string" way doesn't really need any
abstraction. Once this is committed, I'll commit a few of the
altered scripts that I've already worked on, to make it clear by
example how they are to be used.

This seems fine to me, though I haven't personally felt the need for any
of these functions. I'm interested in seeing how they would be used in
scripts first. Can you send some simple scripts using this library.

If we decide to keep this library, we would add the new
stdnse.format_timestamp and similar functions to it.

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: