lib/cl/opts/validate.rb in cl-1.0.5 vs lib/cl/opts/validate.rb in cl-1.1.0
- old
+ new
@@ -84,12 +84,13 @@
raise UnknownValues.new(unknown) if unknown.any?
end
def unknown
@unknown ||= opts.select(&:enum?).map do |opt|
- next unless values.key?(opt.name) && !opt.known?(values[opt.name])
+ unknown = opt.unknown(values[opt.name])
+ next if unknown.empty?
known = opt.enum.map { |str| format_regex(str) }
- [opt.name, values[opt.name], known]
+ [opt.name, unknown, known]
end.compact
end
end
class Range < Validator