From: Trans Date: 2007-06-21T02:41:10+09:00 Subject: GetoptLong, but not on ARGV Is there a way to utilize Getoptlong on an arbitrary command var, ie. not on ARGV. I figure I can alway do something like: require 'getoptlong' my_argv = Shellwords.shellwords( "foo -x" ) const_set(:ARGV, my_argv) opts = GetoptLong.new( [ '-x', GetoptLong::NO_ARGUMENT ] ) But it just doesn't seem proper to reset ARGV. Thanks, T.