Sha256: 982b13b03e78bc305bda53b1f4b636fb240a5e893d615533ab593628d726fbc2

Contents?: true

Size: 857 Bytes

Versions: 8

Compression:

Stored size: 857 Bytes

Contents

require 'optparse'

module VagrantPlugins
  module CloudCommand
    module AuthCommand
      module Command
        class Logout < Vagrant.plugin("2", :command)
          def execute
            options = {}

            opts = OptionParser.new do |o|
              o.banner = "Usage: vagrant cloud auth logout"
              o.separator ""
              o.separator "Log out of Vagrant Cloud"
            end

            # Parse the options
            argv = parse_options(opts)
            return if !argv
            if !argv.empty?
              raise Vagrant::Errors::CLIInvalidUsage,
                help: opts.help.chomp
            end

            @client = Client.new(@env)
            @client.clear_token
            @env.ui.success(I18n.t("cloud_command.logged_out"))
            return 0
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
vagrant-unbundled-2.3.6.0 plugins/commands/cloud/auth/logout.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/commands/cloud/auth/logout.rb
vagrant-unbundled-2.3.3.0 plugins/commands/cloud/auth/logout.rb
vagrant-unbundled-2.3.2.0 plugins/commands/cloud/auth/logout.rb
vagrant-unbundled-2.2.19.0 plugins/commands/cloud/auth/logout.rb
vagrant-unbundled-2.2.18.0 plugins/commands/cloud/auth/logout.rb
vagrant-unbundled-2.2.16.0 plugins/commands/cloud/auth/logout.rb
vagrant-unbundled-2.2.14.0 plugins/commands/cloud/auth/logout.rb