Tab complete case insensitive module options too

bug/bundler_fix
Spencer McIntyre 2014-04-02 23:27:11 -04:00
parent 7d93d28f1d
commit 1c57c0092c
1 changed files with 8 additions and 6 deletions

View File

@ -2035,7 +2035,7 @@ class Core
unless str.blank? unless str.blank?
res = res.select { |term| term.upcase.start_with?(str.upcase) } res = res.select { |term| term.upcase.start_with?(str.upcase) }
res = res.map { |term| str << term[str.length..-1] } res = res.map { |term| str + term[str.length..-1] }
end end
return res return res
@ -2735,6 +2735,8 @@ class Core
# Is this option used by the active module? # Is this option used by the active module?
if (mod.options.include?(opt)) if (mod.options.include?(opt))
res.concat(option_values_dispatch(mod.options[opt], str, words)) res.concat(option_values_dispatch(mod.options[opt], str, words))
elsif (mod.options.include?(opt.upcase))
res.concat(option_values_dispatch(mod.options[opt.upcase], str, words))
end end
# How about the selected payload? # How about the selected payload?
@ -2779,8 +2781,8 @@ class Core
when 'Msf::OptAddressRange' when 'Msf::OptAddressRange'
case str case str
when /^file:(.*)/ when /^file:(.*)/
files = tab_complete_filenames($1,words) files = tab_complete_filenames($1, words)
res += files.map { |f| "file:" << f } if files res += files.map { |f| "file:" + f } if files
when /\/$/ when /\/$/
res << str+'32' res << str+'32'
res << str+'24' res << str+'24'
@ -2813,7 +2815,7 @@ class Core
end end
when 'Msf::OptPath' when 'Msf::OptPath'
files = tab_complete_filenames(str,words) files = tab_complete_filenames(str, words)
res += files if files res += files if files
when 'Msf::OptBool' when 'Msf::OptBool'
@ -2822,8 +2824,8 @@ class Core
when 'Msf::OptString' when 'Msf::OptString'
if (str =~ /^file:(.*)/) if (str =~ /^file:(.*)/)
files = tab_complete_filenames($1,words) files = tab_complete_filenames($1, words)
res += files.map { |f| "file:" << f } if files res += files.map { |f| "file:" + f } if files
end end
end end