2012-04-20 04:33:26 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module CommandUp
|
2012-03-10 21:54:59 +00:00
|
|
|
module StartMixins
|
|
|
|
# This adds the standard `start` command line flags to the given
|
|
|
|
# OptionParser, storing the result in the `options` dictionary.
|
|
|
|
#
|
|
|
|
# @param [OptionParser] parser
|
|
|
|
# @param [Hash] options
|
|
|
|
def build_start_options(parser, options)
|
|
|
|
# Setup the defaults
|
2013-01-31 03:42:54 +00:00
|
|
|
options[:provision_types] = nil
|
2012-03-10 21:54:59 +00:00
|
|
|
|
|
|
|
# Add the options
|
|
|
|
parser.on("--[no-]provision", "Enable or disable provisioning") do |p|
|
2013-01-31 03:39:21 +00:00
|
|
|
options[:provision_enabled] = p
|
2012-03-10 21:54:59 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
parser.on("--provision-with x,y,z", Array,
|
|
|
|
"Enable only certain provisioners, by type.") do |list|
|
2013-01-31 03:51:04 +00:00
|
|
|
options[:provision_types] = list.map { |type| type.to_sym }
|
2012-03-10 21:54:59 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|