method

process_args

Importance_0
v1_9_3_125 - Show latest stable - 0 notes - Class: CommandManager
process_args(args) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems/command_manager.rb, line 128
  def process_args(args)
    args = args.to_str.split(/\s+/) if args.respond_to?(:to_str)
    if args.size == 0
      say Gem::Command::HELP
      terminate_interaction(1)
    end
    case args[0]
    when '-h', '--help'
      say Gem::Command::HELP
      terminate_interaction(0)
    when '-v', '--version'
      say Gem::VERSION
      terminate_interaction(0)
    when /^-/
      alert_error "Invalid option: #{args[0]}.  See 'gem --help'."
      terminate_interaction(1)
    else
      cmd_name = args.shift.downcase
      cmd = find_command(cmd_name)
      cmd.invoke(*args)
    end
  end
Register or log in to add new notes.