Sha256: 1ac24b2d12761029d18214ca62a8f9fd300cff9bc6f602afe9c4e10eafea2404

Contents?: true

Size: 1.15 KB

Versions: 7

Compression:

Stored size: 1.15 KB

Contents

require 'optparse'

require "vagrant"

require File.expand_path("../start_mixins", __FILE__)

module VagrantPlugins
  module CommandUp
    class Command < Vagrant.plugin("2", :command)
      include StartMixins

      def execute
        options = {}
        opts = OptionParser.new do |o|
          o.banner = "Usage: vagrant up [vm-name] [--[no-]provision] [--provider provider] [-h]"
          o.separator ""

          build_start_options(o, options)

          o.on("--provider provider", String,
               "Back the machine with a specific provider.") do |provider|
            options[:provider] = provider
          end
        end

        # Parse the options
        argv = parse_options(opts)
        return if !argv

        # Go over each VM and bring it up
        @logger.debug("'Up' each target VM...")
        with_target_vms(argv, :provider => options[:provider]) do |machine|
          @env.ui.info(I18n.t(
            "vagrant.commands.up.upping",
            :name => machine.name,
            :provider => machine.provider_name))
          machine.action(:up, options)
        end

        # Success, exit status 0
        0
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
vagrantup-1.1.3 plugins/commands/up/command.rb
vagrantup-1.1.2 plugins/commands/up/command.rb
vagrantup-1.1.1 plugins/commands/up/command.rb
vagrantup-1.1.0 plugins/commands/up/command.rb
vagrantup-1.1.4 plugins/commands/up/command.rb
vagrant-actionio-0.0.9 vendor/bundle/bundler/gems/vagrant-c74251a1d9c0/plugins/commands/up/command.rb
vagrant-lxc-0.0.1 vendor/vagrant/plugins/commands/up/command.rb