summaryrefslogtreecommitdiff
path: root/NEWS
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-10-18 17:53:17 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-10-18 17:53:17 +0900
commitddad1fb229421be3dc4b0a3031cb410b62a233a9 (patch)
tree0a5e497552ab85bd3beb4972ebe54d049e0c5340 /NEWS
parente2b719bed640d4813fd5f753c80d33d01c612078 (diff)
NEWS: Mention that optparse now supports did_you_mean for unknown option
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