Sha256: 635ae2ccceb53c6852f8bffd9a41f14d1e5fbdef4dcb68af72e71b98bd1e8976

Contents?: true

Size: 1.39 KB

Versions: 16

Compression:

Stored size: 1.39 KB

Contents

require 'optparse'

module Veewee
  module Command
    module Vagrant
      class Export < ::Vagrant::Command::Base
        def execute
          options = {}

          opts = OptionParser.new do |opts|
            opts.banner = "Exports basebox to the vagrant box format"
            opts.separator ""
            opts.separator "Usage: vagrant basebox export <boxname>"

            opts.on("-d", "--debug", "enable debugging") do |d|
              options['debug'] = d
            end

            opts.on("-f", "--force", "force overwrite") do |f|
              options['force'] = f
            end

            opts.on( "--vagrantfile [FILE]", "vagrantfile") do |f|
              options['vagrantfile'] = f
            end

            opts.on("-i", "--include [FILE]", "include") do |f|
                options['include'] << f
            end

          end

          # Parse the options
          argv = parse_options(opts)
          return if !argv
          raise ::Vagrant::Errors::CLIInvalidUsage, :help => opts.help.chomp if argv.length < 1

          begin
            venv=Veewee::Environment.new(options)
            venv.ui=@env.ui
            box_name=argv[0]
            venv.providers["virtualbox"].get_box(box_name).export_vagrant(options)
          rescue Veewee::Error => ex
            venv.ui.error(ex,:prefix => false)
            exit -1
          end

        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
veewee-0.5.0.alpha4 lib/veewee/command/vagrant/export.rb
veewee-0.5.0.alpha3 lib/veewee/command/vagrant/export.rb
veewee-0.5.0.alpha2 lib/veewee/command/vagrant/export.rb
veewee-0.5.0.alpha1 lib/veewee/command/vagrant/export.rb
veewee-0.4.5.1 lib/veewee/command/vagrant/export.rb
veewee-0.4.5 lib/veewee/command/vagrant/export.rb
veewee-0.4.5.pre1 lib/veewee/command/vagrant/export.rb
veewee-0.4.4 lib/veewee/command/vagrant/export.rb
veewee-0.4.3 lib/veewee/command/vagrant/export.rb
veewee-0.4.2 lib/veewee/command/vagrant/export.rb
veewee-0.4.1 lib/veewee/command/vagrant/export.rb
veewee-0.4.0 lib/veewee/command/vagrant/export.rb
veewee-0.3.12 lib/veewee/command/vagrant/export.rb
veewee-0.3.11 lib/veewee/command/vagrant/export.rb
veewee-0.3.10 lib/veewee/command/vagrant/export.rb
veewee-0.3.9 lib/veewee/command/vagrant/export.rb