Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
OptionParser#additional_message
(untyped typ, untyped opt) -> ::String?
additional_message(typ, opt)
lib/optparse.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/optparse.rb, line 1987
def additional_message(typ, opt)
return unless typ and opt and defined?(DidYouMean::SpellChecker)
all_candidates = []
visit(:get_candidates, typ) do |candidates|
all_candidates.concat(candidates)
end
all_candidates.select! {|cand| cand.is_a?(String) }
checker = DidYouMean::SpellChecker.new(dictionary: all_candidates)
DidYouMean.formatter.message_for(all_candidates & checker.correct(opt))
end
Returns additional info.