Sha256: 4619d6813fd1949ca182e90c00989645bbe8b94dfbeff0a6928ca66272f456f2

Contents?: true

Size: 717 Bytes

Versions: 3

Compression:

Stored size: 717 Bytes

Contents

# frozen_string_literal: true

module VagrantPlugins
  module ProviderLocal
    module Command
      # This is used to shutdown the guest from inside the guest
      class ShutdownGuest < Vagrant.plugin('2', :command)
        def execute
          opts = OptionParser.new do |o|
            o.banner = 'Usage: vagrant local control shutdown [options]'
          end

          argv = parse_options(opts)
          return unless argv

          unless argv.empty?
            @env.ui.info(opts.help)
            return
          end

          ## Wait for VM up
          with_target_vms(argv, provider: :local) do |machine|
            machine.action('shutdown')
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-local-0.0.3 lib/vagrant-local/command/shutdown_guest.rb
vagrant-local-0.0.2 lib/vagrant-local/command/shutdown_guest.rb
vagrant-local-0.0.1 lib/vagrant-local/command/shutdown_guest.rb