[#103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 — eregontp@...
Issue #17777 has been reported by Eregon (Benoit Daloze).
17 messages
2021/04/05
[#103305] [Ruby master Feature#17785] Allow named parameters to be keywords — marcandre-ruby-core@...
Issue #17785 has been reported by marcandre (Marc-Andre Lafortune).
21 messages
2021/04/08
[#103342] [Ruby master Feature#17790] Have a way to clear a String without resetting its capacity — jean.boussier@...
Issue #17790 has been reported by byroot (Jean Boussier).
14 messages
2021/04/09
[#103388] [ANN] Multi-factor Authentication of bugs.ruby-lang.org — SHIBATA Hiroshi <hsbt@...>
Hello,
5 messages
2021/04/12
[#103414] Re: [ANN] Multi-factor Authentication of bugs.ruby-lang.org
— Martin J. Dürst <duerst@...>
2021/04/13
Is there a way to use this multi-factor authentication for (like me)
[#103547] List of CI sites to check — Martin J. Dürst <duerst@...>
Hello everybody,
4 messages
2021/04/22
[#103596] [Ruby master Feature#17830] Add Integer#previous and Integer#prev — rafasoaresms@...
Issue #17830 has been reported by rafasoares (Rafael Soares).
9 messages
2021/04/26
[ruby-core:103566] [Ruby master Bug#17821] Impossible to define only short versions of options in OptionParser
From:
paulo.fidalgo.pt@...
Date:
2021-04-22 21:09:52 UTC
List:
ruby-core #103566
Issue #17821 has been reported by fidalgo (Paulo Fidalgo).
----------------------------------------
Bug #17821: Impossible to define only short versions of options in OptionParser
https://bugs.ruby-lang.org/issues/17821
* Author: fidalgo (Paulo Fidalgo)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
I have tried several approaches and either I'm being misled by the documentation or there's a bug.
I've tried this with two versions of ruby 2.7.2 and 3.0.1, both compiled using rbenv.
Here is the code:
```
require 'optparse'
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: #{$PROGRAM_NAME} [options]"
opts.on('-na', 'Numbers for the first column') { |o| options[:na] = o }
opts.on('-sa', 'Stars for the first column') { |o| options[:sa] = o }
opts.on('-nb', 'Numbers for the first column') { |o| options[:nb] = o }
opts.on('-sb', 'Stars for the first column') { |o| options[:sb] = o }
if ARGV.empty?
puts opts.help
exit 1
end
end.parse!(into: options)
p options
```
and the output:
```
ruby options.rb
Usage: options.rb [options]
-nb Numbers for the first column
-sb Stars for the first column
```
The bug happens because we should have four different options on the help.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>