Bugs: Browse | Submit New | Admin

[#11725] GeoOptLong acts directly and only on ARGV

Date:
2007-06-20 22:21
Priority:
3
Submitted By:
7rans (transami)
Assigned To:
Yukihiro Matsumoto (matz)
Category:
Misc / Other Standard Library
State:
Open
Platform:
 
Summary:
GeoOptLong acts directly and only on ARGV

Detailed description
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.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2007-06-21 06:39
Sender: Shyouhei Urabe

Assigning to matz as this is a feature request.
Date: 2007-06-21 00:39
Sender: Daniel Berger

How is this a bug? This is a feature request. Submit it as a
patch.

Dan

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
assigned_toshyouhei2007-06-21 06:39shyouhei