diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2019-10-18 17:53:17 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2019-10-18 17:53:17 +0900 |
commit | ddad1fb229421be3dc4b0a3031cb410b62a233a9 (patch) | |
tree | 0a5e497552ab85bd3beb4972ebe54d049e0c5340 /NEWS | |
parent | e2b719bed640d4813fd5f753c80d33d01c612078 (diff) | |
download | ruby-ddad1fb229421be3dc4b0a3031cb410b62a233a9.tar.gz |
NEWS: Mention that optparse now supports did_you_mean for unknown option
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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 |