lib/clin/option_parser.rb
# Fetch the next next argument and parse the option or store it as an argument
# @return [Boolean] true if it parsed anything, false if there are no more argument to parse
Fetch the next next argument and parse the option or store it as an argument
Fetch the next next argument and parse the option or store it as an argument
def parse_next
    return false if @argv.empty?
    case (arg = @argv.shift)
    when LONG_OPTION_REGEX
      name = Regexp.last_match[:name]
      value = Regexp.last_match[:value]
      parse_long(name, value)
    when SHORT_OPTION_REGEX
      name = Regexp.last_match[:name]
      value = Regexp.last_match[:value]
      parse_short(name, value)
    else
      @arguments << arg
    end
    true
  end
def parse_next return false if @argv . empty? case ( arg = @argv . shift ) when LONG_OPTION_REGEX name = Regexp . last_match [ :name ] value = Regexp . last_match [ :value ] parse_long ( name , value ) when SHORT_OPTION_REGEX name = Regexp . last_match [ :name ] value = Regexp . last_match [ :value ] parse_short ( name , value ) else @arguments << arg end true end
Fetch the next next argument and parse the option or store it as an argument
Fetch the next next argument and parse the option or store it as an argument
true if it parsed anything, false if there are no more argument to parse
true if it parsed anything false if there are no more argument to parse
Boolean