mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +00:00
Fix @arg nsedoc parsing in Zenmap
Zenmap was only showing the first line of @arg nsedoc entries, since it was capturing the contents with a regular expression, which ends at the first newline. Fixed by simply returning the entire contents with the first word (the name of the arg) stripped off.
This commit is contained in:
@@ -364,9 +364,9 @@ class ScriptMetadata (object):
|
||||
returned as a list of (argname, description) tuples."""
|
||||
args = []
|
||||
for tag_name, tag_text in nsedoc_tags_iter(f):
|
||||
m = re.match(r'([\w._-]+)\s*(.*)', tag_text)
|
||||
m = re.match(r'([\w._-]+)', tag_text)
|
||||
if (tag_name == "arg" or tag_name == "args") and m:
|
||||
args.append((m.group(1), m.group(2)))
|
||||
args.append((m.group(1), re.sub(r'^[\w._-]+','',tag_text)))
|
||||
return args
|
||||
|
||||
def get_arguments(self, filename):
|
||||
|
||||
Reference in New Issue
Block a user