Module: Vagrant::Command::StartMixins

Included in:
Reload, Up
Defined in:
lib/vagrant/command/start_mixins.rb

Instance Method Summary collapse

Instance Method Details

#build_start_options(parser, options) ⇒ Object

This adds the standard start command line flags to the given OptionParser, storing the result in the options dictionary.

Parameters:

  • parser (OptionParser)
  • options (Hash)


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/vagrant/command/start_mixins.rb', line 9

def build_start_options(parser, options)
  # Setup the defaults
  options["provision.enabled"] = true
  options["provision.types"] = nil

  # Add the options
  parser.on("--[no-]provision", "Enable or disable provisioning") do |p|
    options["provision.enabled"] = p
  end

  parser.on("--provision-with x,y,z", Array,
          "Enable only certain provisioners, by type.") do |list|
    options["provision.types"] = list
  end
end