Sha256: c7e18fefc83a881619f8e169ed7210362ca4f55646c1bbf7b1ae8f70deba63f4

Contents?: true

Size: 875 Bytes

Versions: 4

Compression:

Stored size: 875 Bytes

Contents

require 'optparse'
require 'vagrant'

module VagrantSnap

    module Command

        class Take < Vagrant.plugin("2", :command)

            def execute

                options = {}
                options[:snap_name] = nil

                opts = OptionParser.new do |o|

                    o.banner    = "Usage: vagrant snap take [vm-name] [--name=<snapname>]"
                    o.separator ""

                    o.on("--name SNAPNAME", "Use the given name for this snapshot") do |n|
                        options[:snap_name] = n
                    end

                end

                argv = parse_options(opts)
                return if !argv

                with_target_vms(argv) do |vm|

                    vm.action(:snapshot_take, :snap_name => options[:snap_name])

                end

                0

            end

        end

    end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vagrant-multiprovider-snap-0.0.15 lib/vagrant-multiprovider-snap/command/take.rb
vagrant-multiprovider-snap-0.0.14 lib/vagrant-multiprovider-snap/command/take.rb
vagrant-multiprovider-snap-0.0.13 lib/vagrant-multiprovider-snap/command/take.rb
vagrant-multiprovider-snap-0.0.12 lib/vagrant-multiprovider-snap/command/take.rb