GetoptLong is hard coded to act directly on ARGV. That limits it's usefulness or requires the poor practice of setting
ARGV in code. It's probably not a good idea to directly manipulate ARGV anyway. It's better to always have a fall back
copy, so maybe ARGV should actually be frozen. In any case a quick solution is to add something like the following to
GetoptLong:
def argslist
@argslist ||= ARGV.dup
end
def argslist=(args)
@argslist = args
end
And then subing /ARGV/argslist/g.
|