Bug 1307082

Summary: optparse: invalid processing of short -l option
Product: [Fedora] Fedora Reporter: Mikhail Campos <Mikhail_Campos-Guadamuz>
Component: rubyAssignee: Jeroen van Meeuwen <vanmeeuwen+fedora>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: mmorsi, mtasaka, s, strzibny, tagoh, vanmeeuwen+fedora, vondruch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-12 18:18:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Invalid option matching none

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.