Class: VagrantHostel::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-hostel/command.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/vagrant-hostel/command.rb', line 3

def execute
  options = {}
  options[:force] = false

  opts = OptionParser.new do |o|
    o.banner = "Usage: vagrant hostel [vm-name] [no. to replicate]"
    o.separator ""
  end

  # Parse the options
  argv = parse_options(opts)

   puts "Hostel: #{argv}"
   vm_name = argv[0]
   multiple = argv[1]
   puts "#{@env.methods}"

   with_target_vms(vm_name) do |vm|
    puts "#{vm.config.vm.host_name}"
  end

   0
end