Sha256: 31a7a8d9c326f430aec37324ea0bf7d7f41daa55161e54b98616348916bb683c

Contents?: true

Size: 1.05 KB

Versions: 29

Compression:

Stored size: 1.05 KB

Contents

require 'optparse'

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

          opts = OptionParser.new do |opts|
            opts.banner = "List the available templates"
            opts.separator ""
            opts.separator "Usage: vagrant basebox templates"
            opts.on("-d", "--debug", "enable debugging") do |d|
              options['debug'] = d
            end
          end

          # Parse the options
          argv = parse_options(opts)

          return if !argv

          begin
            venv=Veewee::Environment.new(options)
            venv.ui = @env.ui
            venv.ui.info("The following templates are available:",:prefix => false)
            venv.templates.each do |name,template|
              venv.ui.info("vagrant basebox define '<boxname>' '#{name}'",:prefix => false)
            end
          rescue Veewee::Error => ex
            venv.ui.error(ex,:prefix => false)
            exit -1
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

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