Class: Vagrant::Plugin::V2::Command

Inherits:
Object
  • Object
show all
Includes:
Util::SafePuts
Defined in:
lib/vagrant/plugin/v2/command.rb

Overview

This is the base class for a CLI command.

Direct Known Subclasses

Remote::Command

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Util::SafePuts

#safe_puts

Constructor Details

#initialize(argv, env) ⇒ Command

Returns a new instance of Command.



23
24
25
26
27
# File 'lib/vagrant/plugin/v2/command.rb', line 23

def initialize(argv, env)
  @argv = argv
  @env  = env
  @logger = Log4r::Logger.new("vagrant::command::#{self.class.to_s.downcase}")
end

Class Method Details

.synopsisString

This should return a brief (60 characters or less) synopsis of what this command does. It will be used in the output of the help.

Returns:

  • (String)


19
20
21
# File 'lib/vagrant/plugin/v2/command.rb', line 19

def self.synopsis
  ""
end

Instance Method Details

#executeObject

This is what is called on the class to actually execute it. Any subclasses should implement this method and do any option parsing and validation here.



32
33
# File 'lib/vagrant/plugin/v2/command.rb', line 32

def execute
end