2013-02-04 18:22:15 +00:00
|
|
|
require 'optparse'
|
|
|
|
|
|
|
|
require_relative "base"
|
|
|
|
|
|
|
|
module VagrantPlugins
|
|
|
|
module CommandPlugin
|
|
|
|
module Command
|
|
|
|
class License < Base
|
|
|
|
def execute
|
|
|
|
opts = OptionParser.new do |o|
|
|
|
|
o.banner = "Usage: vagrant plugin license <name> <license-file> [-h]"
|
|
|
|
end
|
|
|
|
|
|
|
|
# Parse the options
|
|
|
|
argv = parse_options(opts)
|
|
|
|
return if !argv
|
2014-05-22 16:35:12 +00:00
|
|
|
raise Vagrant::Errors::CLIInvalidUsage, help: opts.help.chomp if argv.length < 2
|
2013-02-04 18:22:15 +00:00
|
|
|
|
|
|
|
# License the plugin
|
|
|
|
action(Action.action_license, {
|
2014-05-22 16:35:12 +00:00
|
|
|
plugin_license_path: argv[1],
|
|
|
|
plugin_name: argv[0]
|
2013-02-04 18:22:15 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
# Success, exit status 0
|
|
|
|
0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|