Sha256: 14efc80c3561a8ac3c24f641a0f099bbc0088feec1a0d1c3adaabc4f20aa0b8e

Contents?: true

Size: 1.12 KB

Versions: 18

Compression:

Stored size: 1.12 KB

Contents

require 'optparse'

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

          opts = OptionParser.new do |opts|
            opts.banner = "Remove the definition of a basebox"
            opts.separator ""
            opts.separator "Usage: vagrant basebox undefine <boxname>"

            opts.on("-d", "--debug", "enable debugging") do |d|
              options['debug'] = d
            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
            definition_name=argv[0]
            venv.definitions.undefine(definition_name,options)
            venv.ui.info("Definition '#{definition_name}' successfully removed",:prefix => false)
          rescue Veewee::Error => ex
            venv.ui.error(ex,:prefix => false)
            exit -1
          end

        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

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