Bug #10021
closedOptParse does not handle missing arguments bracketed by valid option switches
Description
OS=CentOS-6.5 x86_64
Ruby=2.1.2p95
I have this in an optparse structure:
# Create parser
opts = OptionParser.new do |opts|
opts.banner = <<-BANNER
. . .
opts.on("-r", "--rerun=DATEorTRANSACTION", "--re-run=DATEorTRANSACTION",
"Re-run extract for specific date (yyyymmdd)",
" or transaction number (SSSSSNNNNNNNNC).",
" Multiple specifications are ORed for selections.",
" All billable transactions are selectable",
" whether previously billed or not.",
" Sets and enforces --no-update" ) do |rr|
options.rerun << rr
options.update = false
end
. . .
If I run a program incorporating this option class so:
--re-run x --rerun y -r
Then I see this:
missing argument: -r
However, if I do this:
--re-run x --rerun y -r --debug
or this
--re-run x -r --rerun y
Then the program runs and does not report the missing argument.
Is this the intended behaviour? It does not seem correct to me.