# File lib/un.rb, line 32 def setup(options = "") ARGV.map! do |x| case x when /^-/ x.delete "^-#{options}v" when /[*?\[{]/ Dir[x] else x end end ARGV.flatten! ARGV.delete_if{|x| x == "-"} opt_hash = {} OptionParser.new do |o| options.scan(/.:?/) do |s| o.on("-" + s.tr(":", " ")) do |val| opt_hash[s.delete(":").intern] = val end end o.on("-v") do opt_hash[:verbose] = true end o.parse! end yield ARGV, opt_hash end