Nmap Development mailing list archives

Re: [NSE] new function to parse arguments


From: David Fifield <david () bamsoftware com>
Date: Mon, 16 Aug 2010 10:02:37 -0600

On Mon, Aug 16, 2010 at 02:13:33PM +0100, Djalal Harouni wrote:
On 2010-08-16 07:42:27 -0500, Ron wrote:
On Mon, 16 Aug 2010 00:01:31 -0700 Fyodor <fyodor () insecure org> wrote:
On Sat, Aug 14, 2010 at 09:20:15PM -0500, Ron wrote:

Nice, I've been meaning to write something like that. The whole
unsafe=1 thing was pretty ugly.

I'm glad you agree because we're hoping that after the new function is
merged, you'll go and change your scripts and their documentation to
the newer system and syntax :).  We hope other script authors will do
the same.  We set up the function to handle =1 style arguments too so
we have backward compatibility, but we only need to document the new
style.

Cheers,
Fyodor
Yup, when it's merged I'll update any scripts I can. 
BTW, I've updated the function to return multiple script argument values
instead of a table as suggested by Patrick. Committed as r19776.

e.g:
--script-args 'script.arg1=value,script.arg3,script-x.arg=value'
local arg1, arg2, arg3 = get_script_args('script.arg1',
                            'script.arg2','script.arg3')
    => arg1 = value
    => arg2 = nil
    => arg3 = 1

I think this looks good. If there are no other suggestions you can
commit 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: