lib/vcloud/core/logout_cli.rb
def parse(args)
        opt_parser = OptionParser.new do |opts|
          opts.banner = <<-EOS
Usage: #{$0} [options]

Utility for logging out of a vCloud session and preventing future use of the
session token. A `FOG_VCLOUD_TOKEN` environment variable, as provided by
`vcloud-login`, must be present.

          EOS

          opts.on("-h", "--help", "Print usage and exit") do
            $stderr.puts opts
            exit
          end

          opts.on("--version", "Display version and exit") do
            puts Vcloud::Core::VERSION
            exit
          end
        end

        @usage_text = opt_parser.to_s
        begin
          opt_parser.parse!(args)
        rescue OptionParser::InvalidOption => e
          exit_error_usage(e)
        end

        if args.size > 0
          exit_error_usage("too many arguments")
        end
      end
# Create a new instance of the CLI, parsing the arguments supplied
#
# @param argv_array [Array] The Array of ARGV arguments
# @return [Vcloud::Core::LogoutCLI]
Create a new instance of the CLI, parsing the arguments supplied
Create a new instance of the CLI parsing the arguments supplied
def parse(args)
        opt_parser = OptionParser.new do |opts|
          opts.banner = <<-EOS
Usage: #{$0} [options]
Utility for logging out of a vCloud session and preventing future use of the
session token. A `FOG_VCLOUD_TOKEN` environment variable, as provided by
`vcloud-login`, must be present.
          EOS
          opts.on("-h", "--help", "Print usage and exit") do
            $stderr.puts opts
            exit
          end
          opts.on("--version", "Display version and exit") do
            puts Vcloud::Core::VERSION
            exit
          end
        end
        @usage_text = opt_parser.to_s
        begin
          opt_parser.parse!(args)
        rescue OptionParser::InvalidOption => e
          exit_error_usage(e)
        end
        if args.size > 0
          exit_error_usage("too many arguments")
        end
      end
def parse ( args ) opt_parser = OptionParser . new do | opts | opts . banner = <<-EOS 
Usage:  #{ $0 }  [options]

Utility for logging out of a vCloud session and preventing future use of the
session token. A `FOG_VCLOUD_TOKEN` environment variable, as provided by
`vcloud-login`, must be present.

           EOS opts . on ( "-h" , "--help" , "Print usage and exit" ) do $stderr . puts opts exit end opts . on ( "--version" , "Display version and exit" ) do puts Vcloud :: Core :: VERSION exit end end @usage_text = opt_parser . to_s begin opt_parser . parse! ( args ) rescue OptionParser :: InvalidOption => e exit_error_usage ( e ) end if args . size > 0 exit_error_usage ( "too many arguments" ) end end
Create a new instance of the CLI, parsing the arguments supplied
Create a new instance of the CLI parsing the arguments supplied
None
Vcloud::Core::LogoutCLI
args
argv_array
The Array of ARGV arguments
The Array of ARGV arguments