module Coral module Vagrant module SubCommand class CoralImage < ::Vagrant.plugin('2', :command) #----------------------------------------------------------------------- # Execution def execute options = {} success = true opts = OptionParser.new do |opts| opts.banner = 'Usage: coral image --servers={server_name},... {provider} ...' opts.separator '' options[:tries] = 1 opts.on('-t', '--tries TRIES', 'Number of times to try imaging the servers before stopping with an error (1)') do |t| options[:tries] = t end options[:servers] = '' opts.on('-s', '--servers SERVER_NAME,...', 'Server names of servers to image on the specified providers') do |r| options[:servers] = r end end options[:auth] = true #--- providers = parse_options(opts) return unless providers raise ::Vagrant::Errors::CLIInvalidUsage, :help => opts.help.chomp if providers.length < 1 #--------- # Start exit success ? 0 : 1 end end end end end