Skip to content

Commit e64fcfc

Browse files
committed
Land rapid7#8534, Fix nessus_template_list command argument parsing
2 parents 55f0edb + d5a7b29 commit e64fcfc

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

plugins/nessus.rb

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -516,26 +516,16 @@ def cmd_nessus_template_list(*args)
516516
return
517517
when '-S', '--search'
518518
search_term = /#{args.shift}/nmi
519+
else
520+
type = arg
519521
end
520522
end
521523

522524
if !nessus_verify_token
523525
return
524526
end
525-
case args.length
526-
when 1
527-
type = args[0]
528-
else
529-
print_status("Usage: ")
530-
print_status("nessus_template_list <scan> | <policy>")
531-
print_status("Example:> nessus_template_list scan")
532-
print_status("OR")
533-
print_status("nessus_template_list policy")
534-
print_status("Returns a list of information about the scan or policy templates..")
535-
return
536-
end
537527
if type.in?(['scan', 'policy'])
538-
list=@n.list_template(type)
528+
list=@n.list_templates(type)
539529
else
540530
print_error("Only scan and policy are valid templates")
541531
return

0 commit comments

Comments
 (0)