From fdac9750a1ff63fbc3e967e58767fd9c6c861f73 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 28 Aug 2012 12:17:27 +0000 Subject: [PATCH] No longer require the "description" field in scripts. This is so I don't have to do description = "" when writing test scripts. --- nse_main.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/nse_main.lua b/nse_main.lua index f07e77d3e..62b6b1d32 100644 --- a/nse_main.lua +++ b/nse_main.lua @@ -419,7 +419,6 @@ do end local required_fields = { - description = "string", action = "function", categories = "table", dependencies = "table", @@ -1052,7 +1051,9 @@ local function script_help_normal(chosen_scripts) log_write_raw("stdout", format("%s\n", script.id)); log_write_raw("stdout", format("Categories: %s\n", concat(script.categories, " "))); log_write_raw("stdout", format("%s\n", nsedoc_url(script.id))); - log_write_raw("stdout", format_nsedoc(script.description, " ")); + if script.description then + log_write_raw("stdout", format_nsedoc(script.description, " ")); + end end end @@ -1085,10 +1086,12 @@ local function script_help_xml(chosen_scripts) cnse.xml_end_tag(); cnse.xml_newline(); - cnse.xml_start_tag("description"); - cnse.xml_write_escaped(script.description); - cnse.xml_end_tag(); - cnse.xml_newline(); + if script.description then + cnse.xml_start_tag("description"); + cnse.xml_write_escaped(script.description); + cnse.xml_end_tag(); + cnse.xml_newline(); + end -- script cnse.xml_end_tag();