Sha256: 11e17c0a11fbf4b5ce859cbbad2bb0c405ad662bb7d8438a4ecaf78ba0c91a23

Contents?: true

Size: 722 Bytes

Versions: 1

Compression:

Stored size: 722 Bytes

Contents

require 'oscar/skeleton'

class Oscar::Command::Init < Vagrant.plugin('2', :command)

  include Oscar::Command::Helpers

  def initialize(argv, env)
    @argv     = argv
    @env      = env
    @cmd_name = 'oscar init'

    @provider = nil

    split_argv
  end

  def execute
    argv = parse_options(parser)

    skeleton = Oscar::Skeleton.new(@env, @provider)
    skeleton.generate

    @env.ui.info I18n.t('oscar.command.init.default')
  end

  private

  def parser
    OptionParser.new do |o|
      o.banner = "Usage: vagrant #{@cmd_name} [<args>]"
      o.separator ''

      o.on('-p', '--provider=val', String, 'The Vagrant provider type to template') do |val|
        @provider = val
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
oscar-0.3.0 lib/oscar/command/init.rb