Class: VagrantPlugins::DevCommands::InternalCommand::Help

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant/devcommands/internal_command/help.rb

Overview

Internal “help” command

Constant Summary collapse

UTIL =
VagrantPlugins::DevCommands::Util
MESSAGES =
VagrantPlugins::DevCommands::Messages
PRINTER =
VagrantPlugins::DevCommands::HelpPrinter

Instance Method Summary collapse

Constructor Details

#initialize(env, registry) ⇒ Help

Returns a new instance of Help.



10
11
12
13
# File 'lib/vagrant/devcommands/internal_command/help.rb', line 10

def initialize(env, registry)
  @env      = env
  @registry = registry
end

Instance Method Details

#execute(argv) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/vagrant/devcommands/internal_command/help.rb', line 15

def execute(argv)
  return message(:no_commands) if @registry.commands.empty?

  command = argv[0]

  return plugin_help(command) unless @registry.available?(command)
  return internal_help(command) if @registry.reserved_command?(command)

  help(command)
end