class Thor::Options
def check_unknown!
def check_unknown! to_check = @stopped_parsing_after_extra_index ? @extra[0...@stopped_parsing_after_extra_index] : @extra # an unknown option starts with - or -- and has no more --'s afterward. unknown = to_check.select { |str| str =~ /^--?(?:(?!--).)*$/ } raise UnknownArgumentError.new(@switches.keys, unknown) unless unknown.empty? end