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.

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.


20
21
22
23
24
# File 'lib/vagrant/plugin/v2/command.rb', line 20

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)

16
17
18
# File 'lib/vagrant/plugin/v2/command.rb', line 16

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.


29
30
# File 'lib/vagrant/plugin/v2/command.rb', line 29

def execute
end