Method: Rex::Ui::Text::DispatcherShell::CommandDispatcher#deprecated_cmd

Defined in:
lib/rex/ui/text/dispatcher_shell.rb

#deprecated_cmd(method = nil, *args) ⇒ Object

Print a warning that the called command is deprecated and optionally forward to the replacement method (useful for when commands are renamed).



131
132
133
134
135
136
137
138
139
140
# File 'lib/rex/ui/text/dispatcher_shell.rb', line 131

def deprecated_cmd(method=nil, *args)
  cmd = caller[0].match(/`cmd_(.*)'/)[1]
  print_error "The #{cmd} command is DEPRECATED"
  if cmd == "db_autopwn"
    print_error "See http://r-7.co/xY65Zr instead"
  elsif method and self.respond_to?("cmd_#{method}", true)
    print_error "Use #{method} instead"
    self.send("cmd_#{method}", *args)
  end
end