<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/optparse, branch ruby_2_7</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>`LoadError` is not a subclass of `StandardError`</title>
<updated>2019-11-29T02:25:23+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2019-11-29T02:25:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5ad32d5504499f1a915d5d30e59dfd98da6759c6'/>
<id>5ad32d5504499f1a915d5d30e59dfd98da6759c6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>test/optparse/test_did_you_mean.rb - fix suggestion order</title>
<updated>2019-10-21T00:53:56+00:00</updated>
<author>
<name>MSP-Greg</name>
<email>MSP-Greg@users.noreply.github.com</email>
</author>
<published>2019-10-20T23:30:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=71ffe40a447a17a1c3388374b7c9979c826b131d'/>
<id>71ffe40a447a17a1c3388374b7c9979c826b131d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Support DidYouMean by AmbiguousOption too</title>
<updated>2019-10-18T08:46:53+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2019-10-18T08:46:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e2b719bed640d4813fd5f753c80d33d01c612078'/>
<id>e2b719bed640d4813fd5f753c80d33d01c612078</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Default DidYouMean.formatter to PlainFormatter</title>
<updated>2019-10-18T07:43:40+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2019-10-18T07:43:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e29e49abf018730d8419b4797ff17942e00d810b'/>
<id>e29e49abf018730d8419b4797ff17942e00d810b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Added no suggestion test case</title>
<updated>2019-10-18T06:19:26+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2019-10-18T06:19:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d4e52f672cf520d6929d22310a340e09fcb0e35d'/>
<id>d4e52f672cf520d6929d22310a340e09fcb0e35d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use DidYouMean.formatter</title>
<updated>2019-10-18T06:18:36+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2019-10-18T06:15:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=46fa301e82d50161fc7ec8e455d9d498b15b2c7a'/>
<id>46fa301e82d50161fc7ec8e455d9d498b15b2c7a</id>
<content type='text'>
Instead of building messages separately.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of building messages separately.
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/optparse.rb: Show a did_you_mean hint for unknown option</title>
<updated>2019-10-18T03:20:58+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2019-10-16T07:31:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c3b64a86bcd7773c081f5049115c57ec73d7a76a'/>
<id>c3b64a86bcd7773c081f5049115c57ec73d7a76a</id>
<content type='text'>
```
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 `&lt;main&gt;': invalid option: --baa (OptionParser::InvalidOption)
Did you mean?  baz
               bar
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
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 `&lt;main&gt;': invalid option: --baa (OptionParser::InvalidOption)
Did you mean?  baz
               bar
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed the test-case class name for zsh</title>
<updated>2019-06-28T05:09:17+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2019-06-28T05:08:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ef45fd53e47975f94661ea71ce78a1c1fa442bcb'/>
<id>ef45fd53e47975f94661ea71ce78a1c1fa442bcb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow --enable/--disable options to take an argument</title>
<updated>2019-05-15T08:31:11+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2019-05-15T08:22:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c9b28fd7ae5c5a79a74afebd5b191cfd2f31a65f'/>
<id>c9b28fd7ae5c5a79a74afebd5b191cfd2f31a65f</id>
<content type='text'>
[Bug #15850]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #15850]
</pre>
</div>
</content>
</entry>
<entry>
<title>optparse: Suppress warnings</title>
<updated>2018-05-06T09:53:33+00:00</updated>
<author>
<name>nobu</name>
<email>nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-05-06T09:53:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2ad7fb6dc16baee28c3840bce6d43cc6698aaa6c'/>
<id>2ad7fb6dc16baee28c3840bce6d43cc6698aaa6c</id>
<content type='text'>
Ruby warns "instance variable `@version` not initialized" for optparse when it receives `--version` option.

`test.rb`

```ruby
require 'optparse'
Version = '1'
OptionParser.new.parse(ARGV)
```

```
$ ruby -w test.rb --version
/home/pocke/.rbenv/versions/2.5.1/lib/ruby/2.5.0/optparse.rb:1168: warning: instance variable @version not initialized
/home/pocke/.rbenv/versions/2.5.1/lib/ruby/2.5.0/optparse.rb:1175: warning: instance variable @release not initialized
test 1
```

This change will suppress the warnings.

[Fix GH-1871]

From: Masataka Pocke Kuwabara &lt;kuwabara@pocke.me&gt;

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ruby warns "instance variable `@version` not initialized" for optparse when it receives `--version` option.

`test.rb`

```ruby
require 'optparse'
Version = '1'
OptionParser.new.parse(ARGV)
```

```
$ ruby -w test.rb --version
/home/pocke/.rbenv/versions/2.5.1/lib/ruby/2.5.0/optparse.rb:1168: warning: instance variable @version not initialized
/home/pocke/.rbenv/versions/2.5.1/lib/ruby/2.5.0/optparse.rb:1175: warning: instance variable @release not initialized
test 1
```

This change will suppress the warnings.

[Fix GH-1871]

From: Masataka Pocke Kuwabara &lt;kuwabara@pocke.me&gt;

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
</feed>
