Project

General

Profile

Bug #12315

OptionParser parses quoted --dash strings in 2.3.0

Added by mreq (Petr Marek) over 3 years ago. Updated 27 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
[ruby-core:75155]

Description

Working on 2.2.4:

wmctile -c -x 'subl --new-window' --switch-to 'sublime_text.Sublime_text'

On 2.3.0, it fails:

wmctile -c -x 'subl --new-window' --switch-to 'sublime_text.Sublime_text'
wmctile/bin/wmctile:23:in `<main>': invalid option: --new-window (OptionParser::InvalidOption)

As seen above, even though the --new-window is a part of a string, OptionParser tries to handle it.

History

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Status changed from Open to Feedback

I can't reproduce it.

$ ruby -roptparse -e 'ARGV.options{|opt|opt.on("-x=STR"){|x|p x}; opt.parse!}' -- -x 'a -b'
"a -b"

Is wmctile in wmctile/bin?
Isn't it another wrapper shell script file?
What does type wmctile show?

Updated by mreq (Petr Marek) over 3 years ago

Nobuyoshi Nakada wrote:

I can't reproduce it.

$ ruby -roptparse -e 'ARGV.options{|opt|opt.on("-x=STR"){|x|p x}; opt.parse!}' -- -x 'a -b'
"a -b"

Is wmctile in wmctile/bin?
Isn't it another wrapper shell script file?
What does type wmctile show?

It's working now on a different machine. Might've been a local problem. Sorry for bothering. How do I close this bug?

#3

Updated by jeremyevans0 (Jeremy Evans) 27 days ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF