Class: Veewee::Command::BaseboxBuild

Inherits:
Vagrant::Command::Base
  • Object
show all
Defined in:
lib/veewee/command/basebox_build.rb

Instance Method Summary collapse

Instance Method Details

#executeObject

Raises:

  • (Vagrant::Errors::CLIInvalidUsage)


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/veewee/command/basebox_build.rb', line 6

def execute
  options = {}

  opts = OptionParser.new do |opts|
    opts.banner = "Build the box <boxname>"
    opts.separator ""
    opts.separator "Usage: vagrant basebox build <boxname>"

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

    opts.on("-n", "--nogui", "no gui") do |n|
      options['nogui'] = n
    end
  end

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

  Veewee::Session.build(argv[0], options)
end