aboutsummaryrefslogtreecommitdiffstats
path: root/NEWS
diff options
context:
space:
mode:
Diffstat (limited to 'NEWS')
-rw-r--r--NEWS17
1 files changed, 17 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index aadb1224c9..5d10fecec9 100644
--- a/NEWS
+++ b/NEWS
@@ -401,6 +401,23 @@ open-uri::
* The default charset of text/* media type is UTF-8 instead of
ISO-8859-1. [Bug #15933]
+OptionParser::
+
+ * Now show "Did you mean?" for unknown option. [Feature #16256]
+
+ require 'optparse'
+ OptionParser.new do |opts|
+ opts.on("-f", "--foo", "foo") {|v| }
+ opts.on("-b", "--bar", "bar") {|v| }
+ opts.on("-c", "--baz", "baz") {|v| }
+ end.parse!
+
+ $ ruby test.rb --baa
+ Traceback (most recent call last):
+ test.rb:7:in `<main>': invalid option: --baa (OptionParser::InvalidOption)
+ Did you mean? baz
+ bar
+
Pathname::
* Delegates 3 arguments from Pathname.glob to Dir.glob to