Add references to info output for post modules

[Fixes #6902] [Closes #409]

Squashed commit of the following:

commit e29bf83196e39853d12b58d77db1ffdb26fbb6eb
Author: James Lee <egypt@metasploit.com>
Date:   Tue May 22 10:01:12 2012 -0600

    Add references to info output for post modules

commit e0147f0f05375d812ecfd55f9c2cb4bffabc1887
Author: James Lee <egypt@metasploit.com>
Date:   Tue May 22 10:05:32 2012 -0600

    Put references after description for consistency
unstable
James Lee 2012-05-22 11:23:48 -05:00 committed by Tod Beardsley
parent 87ce3fe2f7
commit 3bd0276ab3
1 changed files with 23 additions and 15 deletions

View File

@ -165,13 +165,7 @@ class ReadableText
output << "\n" output << "\n"
# References # References
if (mod.references.length > 0) output << dump_references(mod, indent)
output << "References:\n"
mod.references.each { |ref|
output << indent + ref.to_s + "\n"
}
output << "\n"
end
return output return output
@ -209,13 +203,7 @@ class ReadableText
output << "\n" output << "\n"
# References # References
if (mod.references.length > 0) output << dump_references(mod, indent)
output << "References:\n"
mod.references.each { |ref|
output << indent + ref.to_s + "\n"
}
output << "\n"
end
return output return output
end end
@ -279,10 +267,16 @@ class ReadableText
} }
output << "\n" output << "\n"
output << dump_references(mod, indent)
# Description # Description
output << "Description:\n" output << "Description:\n"
output << word_wrap(Rex::Text.compress(mod.description)) output << word_wrap(Rex::Text.compress(mod.description))
output << "\n\n" output << "\n"
output << dump_references(mod, indent)
output << "\n"
return output return output
@ -369,6 +363,20 @@ class ReadableText
return output return output
end end
def self.dump_references(mod, indent = '')
output = ''
if (mod.respond_to? :references and mod.references and mod.references.length > 0)
output << "References:\n"
mod.references.each { |ref|
output << indent + ref.to_s + "\n"
}
output << "\n"
end
output
end
# #
# Dumps the contents of a datastore. # Dumps the contents of a datastore.
# #