Bug 1307082 - optparse: invalid processing of short -l option
Summary: optparse: invalid processing of short -l option
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: ruby
Version: 22
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Jeroen van Meeuwen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-12 16:21 UTC by Mikhail Campos
Modified: 2016-02-12 18:18 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-12 18:18:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Invalid option matching (228 bytes, text/plain)
2016-02-12 16:21 UTC, Mikhail Campos
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Ruby 11523 0 None None None Never

Description Mikhail Campos 2016-02-12 16:21:32 UTC
Created attachment 1123572 [details]
Invalid option matching

Description of problem:
Whenever I define and use the option '-l' with 'optparse', '-d' matches the same option as '-l'

Version-Release number of selected component (if applicable):
ruby-libs-2.2.3-44.fc22.x86_64

How reproducible:
Always

Steps to reproduce:

1.$ ruby test.rb -l /tmp 
{:dir_for_load=>"/tmp"}
2.$ ruby test.rb -d /tmp/2
{:dir_for_load=>"/tmp/2"}
3. Should be like this:
$ ruby test.rb -x /tmp 
test.rb:10:in `<main>': invalid option: -x (OptionParser::InvalidOption)

Actual results:
-d matches the same option as -l, but should not

Expected results:
Should match only specified short value (-l)

Additional info:
Test script is attached

Comment 1 Vít Ondruch 2016-02-12 18:18:46 UTC
Thank you for your report. Nevertheless:

1) I think this is spec and I explained my reasoning in the upstream ticket.

2) This is really upstream issue and I don't think it makes sense to let Fedora diverge from upstream. So if that is 'fixed' upstream, it will get into Fedora as soon as official release gets published. Please continue the discussion in upstream ticket if you wish.


Of course feel free to re-open this ticket if you disagree.


Note You need to log in before you can comment on or make changes to this bug.