From 6fecb78c2982960e17caf61309d0b2146fa37722 Mon Sep 17 00:00:00 2001 From: dl267 <devnull@localhost> Date: Sun, 18 Apr 2004 20:57:30 +0200 Subject: [PATCH] [svn r5737] Modified command line parsing so arguments commute. --- noinfo/make-indxal4.pl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/noinfo/make-indxal4.pl b/noinfo/make-indxal4.pl index 94613b0ba..c94b2a44b 100755 --- a/noinfo/make-indxal4.pl +++ b/noinfo/make-indxal4.pl @@ -1,5 +1,6 @@ #!/usr/bin/perl -w use strict; +use Getopt::Long; # no file made for 1996-01 (e.g.) Fix it. # 136 ents are in 161. why? @@ -7,6 +8,14 @@ use strict; ((my $progname = $0) =~ s/^.*(\/|\\)//ig); # basename $0 +my $no_verbose_progress = 0; +#if ($ARGV[1]) { +# if ($ARGV[1] eq "-q") { +# $verbose_progress = undef; +# } +#} +GetOptions(q => \$no_verbose_progress); + unless ($ARGV[0]) { print "Specify a CSV file name as the first argument (e.g. CAVETAB2.CSV)\n"; die $!; @@ -14,12 +23,6 @@ unless ($ARGV[0]) { open (CSV, "< $ARGV[0]"); -my $verbose_progress = 1; -if ($ARGV[1]) { - if ($ARGV[1] eq "-q") { - $verbose_progress = undef; - } -} # Start writing index file open IDXALL, ">..\/indxal.htm" or die $!; @@ -174,7 +177,7 @@ sub do_this_line { return; } - if ($verbose_progress) { + unless ($no_verbose_progress) { print "Progress: $file\n"; }