diff options
| author | Yusuke Endoh <mame@ruby-lang.org> | 2019-10-16 16:31:41 +0900 |
|---|---|---|
| committer | Yusuke Endoh <mame@ruby-lang.org> | 2019-10-18 12:20:58 +0900 |
| commit | c3b64a86bcd7773c081f5049115c57ec73d7a76a (patch) | |
| tree | eb4cc5141106c3da19624a1efb3f8db02dc7fd87 /spec/ruby/core/array/shift_spec.rb | |
| parent | 5ca5529d223ee962451685badc9e928ea87dbb44 (diff) | |
lib/optparse.rb: Show a did_you_mean hint for unknown option
```
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
```
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2561
Diffstat (limited to 'spec/ruby/core/array/shift_spec.rb')
0 files changed, 0 insertions, 0 deletions
