Version info toggle for git vs svn checkouts

Version numbers are kind of meaningless in git development branches, but
are reportedly useful for SVN checkouts.

[See #6254]
unstable
Tod Beardsley 2012-01-17 14:35:33 -06:00
parent a682e68073
commit cfca791480
1 changed files with 8 additions and 4 deletions

View File

@ -2264,10 +2264,14 @@ class Core
# Returns the revision of the framework and console library # Returns the revision of the framework and console library
# #
def cmd_version(*args) def cmd_version(*args)
ver = "$Revision: 14065 $" svn_console_version = "$Revision: 14065 $"
svn_metasploit_version = Msf::Framework::Revision.match(/ (.+?) \$/)[1] rescue nil
print_line("Framework: #{Msf::Framework::Version}.#{Msf::Framework::Revision.match(/ (.+?) \$/)[1]}") if svn_metasploit_version
print_line("Console : #{Msf::Framework::Version}.#{ver.match(/ (.+?) \$/)[1]}") print_line("Framework: #{Msf::Framework::Version}.#{svn_metasploit_version}")
else
print_line("Framework: #{Msf::Framework::Version}")
end
print_line("Console : #{Msf::Framework::Version}.#{svn_console_version.match(/ (.+?) \$/)[1]}")
return true return true
end end