Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

OptionParser::Switch#parse_arg

parse_arg(arg) { |InvalidArgument, arg| ... }

Parses arg and returns rest of arg and matched portion to the argument pattern. Yields when the pattern doesn’t match substring.