Class: Msf::Plugin::Sample::ConsoleCommandDispatcher

Inherits:
Object
  • Object
show all
Includes:
Ui::Console::CommandDispatcher
Defined in:
plugins/sample.rb

Overview

This class implements a sample console command dispatcher.

Instance Attribute Summary

Attributes included from Ui::Console::CommandDispatcher

#driver

Attributes included from Rex::Ui::Text::DispatcherShell::CommandDispatcher

#shell, #tab_complete_items

Instance Method Summary collapse

Methods included from Ui::Console::CommandDispatcher

#active_module, #active_module=, #active_session, #active_session=, #build_range_array, #docs_dir, #framework, #initialize, #log_error, #remove_lines

Methods included from Rex::Ui::Text::DispatcherShell::CommandDispatcher

#cmd_help, #cmd_help_help, #cmd_help_tabs, #deprecated_cmd, #deprecated_commands, #deprecated_help, #docs_dir, #help_to_s, #initialize, #print, #print_error, #print_good, #print_line, #print_status, #print_warning, #tab_complete_directory, #tab_complete_filenames, #tab_complete_generic, #tab_complete_source_address, #update_prompt

Instance Method Details

#cmd_sample(*args) ⇒ Object

This method handles the sample command.


45
46
47
# File 'plugins/sample.rb', line 45

def cmd_sample(*args)
  print_line("You passed: #{args.join(' ')}")
end

#commandsObject

Returns the hash of commands supported by this dispatcher.


36
37
38
39
40
# File 'plugins/sample.rb', line 36

def commands
  {
    "sample" => "A sample command added by the sample plugin"
  }
end

#nameObject

The dispatcher's name.


29
30
31
# File 'plugins/sample.rb', line 29

def name
  "Sample"
end