Method: Uspec::CLI#parse_options

Defined in:
lib/uspec/cli.rb

#parse_options(args) ⇒ Object



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/uspec/cli.rb', line 89

def parse_options args
  args.each_with_index do |arg, i|
    if arg == '--' then
      return args
    elsif arg == '--full_backtrace' then
      Uspec::Errors.full_backtrace!
      args.delete_at i
    elsif !(args & %w[-h --help -? /? -v --version]).empty?
      usage
    elsif arg[0] == ?- then
      warn "unknown option: #{arg}"
      args.delete_at i
    end
  end
end