Method: Thor::Arguments.split

Defined in:
lib/thor/parser/arguments.rb

.split(args) ⇒ Object

Receives an array of args and returns two arrays, one with arguments and one with switches.



8
9
10
11
12
13
14
15
16
17
# File 'lib/thor/parser/arguments.rb', line 8

def self.split(args)
  arguments = []

  args.each do |item|
    break if item =~ /^-/
    arguments << item
  end

  [arguments, args[Range.new(arguments.size, -1)]]
end