[#73707] [Ruby trunk Misc#12004] Code of Conduct — hanmac@...
Issue #12004 has been updated by Hans Mackowiak.
3 messages
2016/02/05
[#73730] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/07
[#73746] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/09
[#73919] [Ruby trunk Feature#11262] Make more objects behave like "Functions" — Ruby-Lang@...
Issue #11262 has been updated by J旦rg W Mittag.
3 messages
2016/02/22
[#74019] [Ruby trunk Bug#12103][Rejected] ruby process hangs while executing regular expression. — duerst@...
Issue #12103 has been updated by Martin D端rst.
3 messages
2016/02/27
[ruby-core:73784] [Ruby trunk Bug#11523] optparse short options will match complete options
From:
v.ondruch@...
Date:
2016-02-12 18:13:08 UTC
List:
ruby-core #73784
Issue #11523 has been updated by Vit Ondruch.
I believe that:
1. This is what OptParser doing by default. If your code were `opts.on("--irs [OCTAL]", OptionParser::OctalInteger,`, i.e. without the '-F', you would get '--irs' as well as shorthand '-i' available. Your case is bit specific, that the short and long parameters are quite different.
2. If you override the '-i' option somewhere and give it different meaning, the OptParser will handle it correctly.
3. If you really want to avoid the default short version of '-i', I can't see anything easier then fire the OptionParser::InvalidOption in the '-i' handler.
----------------------------------------
Bug #11523: optparse short options will match complete options
https://bugs.ruby-lang.org/issues/11523#change-56963
* Author: Micha J
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: 2.2
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
In short, if I define an option like `"-F", "--irs [OCTAL]"`, `-i` will match this option, although the short version is defined as `-F`.
----
In long, this can be quite troublesome:
See the provided example
http://ruby-doc.org/stdlib-2.2.0/libdoc/optparse/rdoc/OptionParser.html
and change or remove the `"-i", "--inplace [EXTENSION]"` option for something else than `i`:
Now, the -i will still match, but the other option `"-F", "--irs [OCTAL]"`!
In a more complete stack this resulted in a hard to find error. Also, to fix this (and raise the required error) you need to check the ARGV directly which renders optparse a bit less useful.
--
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>