1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

Use consistent matching between NSEdoc and Zenmap parsers. Bad example: creds.[service]

This commit is contained in:
dmiller
2018-10-03 16:57:53 +00:00
parent 356831b129
commit 5a505b9fc9

View File

@@ -456,9 +456,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._-]+)', tag_text)
m = re.match(r'(\S+)\s+(.*?)', tag_text, re.DOTALL)
if (tag_name == "arg" or tag_name == "args") and m:
args.append((m.group(1), re.sub(r'^[\w._-]+', '', tag_text)))
args.append((m.group(1), m.group(2)))
return args
def get_arguments(self, filename):