J
Joel VanderWerf
Why does getopts delete the option _arguments_ but not the options
themselves from ARGV:
$ cat opt.rb
require "getopt/long"
include Getopt
opts = Long.getopts(
["--plot", BOOLEAN],
["--foo", OPTIONAL]
)
p ARGV
$ ruby opt.rb --plot --foo 8
["--plot", "--foo"]
Wouldn't it be better for #getopts to delete all members of ARGV that it
recognizes? Then you can use ARGF for the remaining file names.
themselves from ARGV:
$ cat opt.rb
require "getopt/long"
include Getopt
opts = Long.getopts(
["--plot", BOOLEAN],
["--foo", OPTIONAL]
)
p ARGV
$ ruby opt.rb --plot --foo 8
["--plot", "--foo"]
Wouldn't it be better for #getopts to delete all members of ARGV that it
recognizes? Then you can use ARGF for the remaining file names.