require ‘optparse’
options = {}
optparse = OptionParser.new do|opts|
opts.banner = “Usage: file1 file2 …”
opts.on( ‘-r’, ‘–hhhh’, ‘screen’ ) do
puts opts
end
opts.on( ‘-s’, ‘–ssss’, ‘Display this screen’ ) do
puts opts
end
opts.parse!
end
=======
ning@ning:~$ ruby xb.rb -h
Usage: file1 file2 …
-r, --hhhh screen
-s, --ssss Display this screen
I use -h opinion, then it put out all opinion. but -h opinion doesn’t
exit.
why this happened? can someone penlight me?