lib/vagrant-rimu/commands/rebuild.rb in vagrant-rimu-0.0.2 vs lib/vagrant-rimu/commands/rebuild.rb in vagrant-rimu-0.0.3

- old
+ new

@@ -1,19 +1,18 @@ require 'optparse' +require 'vagrant-rimu/commands/abstract_command' module VagrantPlugins module Rimu module Commands - class Rebuild < Vagrant.plugin('2', :command) - def execute - opts = OptionParser.new do |o| - o.banner = 'Usage: vagrant rebuild [vm-name]' - end - argv = parse_options(opts) - with_target_vms(argv) do |machine| - machine.action(:rebuild) - end - 0 + class Rebuild < AbstractCommand + def self.synopsis + I18n.t('vagrant_rimu.commands.rebuild') + end + + def cmd(name, argv, env) + fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 0 + env[:machine].action('rebuild') end end end end end