Bug 1307082 - optparse: invalid processing of short -l option
optparse: invalid processing of short -l option
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: ruby (Show other bugs)
22
Unspecified Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Jeroen van Meeuwen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-12 11:21 EST by Mikhail Campos
Modified: 2016-02-12 13:18 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-12 13:18:46 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Mikhail Campos 2016-02-12 11:21:32 EST
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 13:18:46 EST
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.