From: Talha Oktay Date: 2006-04-02T22:06:31+09:00 Subject: odd number list for hash error and command line parsers in general ------=_Part_33699_4454813.1143983187458 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, I am trying to use getoptlong package. From the documentation I have borrowed the following code fragment with a little modification. I receive "odd number list for hash" error at eval statement between somewhere sub and gsub. I could not understand the reason. The code tries t= o generate the $OPT_HELP, $OPT_INDIR etc. variables. Any help will be much appreciated. I really hate to be forced to iterate over the options to get the values of options in Getoptlong package. Receiving options in hash and making necessary checks as getopt package provides is more convinient for me. According to me, It is easier to check mutual exclusions, dependencies in this schema. I do not understand why getoptlong package does not provide a convinent hash the options as getopt package provides. I do not see what is improved over Getopt other than longer options. I have played getopt-declare package about a day. Theory is good but implementation I believe lacks certain features that I find irritating. I a= m still in search of good user friendly command line / option parser. I would like to learn what you prefer. opts =3D GetoptLong.new() opts.set_options( [ "--indir", "-i", GetoptLong::REQUIRED_ARGUMENT ], [ "--outdir", "-o", GetoptLong::REQUIRED_ARGUMENT ], [ "--help", "-h", GetoptLong::NO_ARGUMENT ], [ "--version","-v", GetoptLong::NO_ARGUMENT ] ) begin opts.each_option do |name, arg| eval "$OPT_#{name.sub(/^-+/, {''}).gsub!(/-/, {'_'}).upcase!} =3D '#{arg}'" end rescue exit(1) end ------=_Part_33699_4454813.1143983187458--