2009/4/27 mdiam <Maurice.Diamantini / gmail.com>:
> Another question about OptionParser class:
>
> How can we add the classical "--" pseudo-option which says not
> to parse the following flags as in
>
> rm -- -file_name_to_delete_with_a_dash_in_it

Did you try it out?  This is default behavior of OptionParser:

15:00:10 Temp$ ruby19 x.rb -x a b
["-x", "a", "b"]
x found!
["a", "b"]
15:00:18 Temp$ ruby19 x.rb -- -x a b
["--", "-x", "a", "b"]
["-x", "a", "b"]
15:00:22 Temp$ cat x.rb
require 'optparse'

p ARGV

OptionParser.new do |o|
  o.on "-x" do
    puts "x found!"
  end
end.parse! ARGV

p ARGV

15:00:25 Temp$

Kind regards

robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/