Class: VagrantPlugins::VBoxSnapshot::Command::Delete
- Inherits:
-
Object
- Object
- VagrantPlugins::VBoxSnapshot::Command::Delete
- Includes:
- CheckRunnable, MultiVmArgs
- Defined in:
- lib/vagrant-vbox-snapshot/commands/delete.rb
Instance Method Summary collapse
Methods included from CheckRunnable
Methods included from MultiVmArgs
#parse_vm_and_snapshot_options
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/vagrant-vbox-snapshot/commands/delete.rb', line 14 def execute = {} opts = OptionParser.new do |opts| opts. = "Delete snapshot (warning: this is a very slow operation)" opts.separator "" opts.separator "Usage: vagrant snapshot delete [vm-name] <SNAPSHOT_NAME>" end # Parse the options argv = (opts) return if !argv vm_name, snapshot_name = (argv, opts) return if !snapshot_name with_target_vms(vm_name, single_target: true) do |machine| check_runnable_on(machine) machine.provider.driver.execute("snapshot", machine.id, "delete", snapshot_name) do |type, data| machine.env.ui.info(data, :color => type == :stderr ? :red : :white) end end end |