add by_dxcc to sh/dx
[spider.git] / cmd / show / dx.pl
index f99a2b6cf8c1a08c81bb6e5aee15e1da5e05ad61..f359aec0cd0cef3ff60a3343fd4f99e830ad4936 100644 (file)
@@ -28,6 +28,7 @@ my $bystate;
 my $itu;
 my $byitu;
 my $fromdxcc;
+my $exact;
 my ($doqsl, $doiota, $doqra, $dofilter);
 
 while ($f = shift @list) {             # next field
@@ -40,6 +41,10 @@ while ($f = shift @list) {           # next field
                ($to) = $f =~ /^(\d+)$/o if !$to; # is it a to count?
                next if $to;
        }
+       if (lc $f eq 'exact') {
+               $exact = 1;
+               next;
+       }
        if (lc $f eq 'dxcc') {
                $dxcc = 1;
                next;
@@ -76,10 +81,12 @@ while ($f = shift @list) {          # next field
                $info = shift @list;
                next;
        }
-       if ((lc $f eq 'spotter' || lc $f eq 'by') && $list[0]) {
+       if ((lc $f eq 'spotter' || lc $f eq 'by' || lc $f eq 'by_dxcc') && $list[0]) {
                #    print "got spotter\n";
                $spotter = uc shift @list;
-               if ($list[0] && lc $list[0] eq 'dxcc') {
+               if ($f eq 'by_dxcc') {
+                       $fromdxcc = 1;
+               } elsif ($list[0] && lc $list[0] eq 'dxcc') {
                        $fromdxcc = 1;
                        shift @list;
                }
@@ -180,6 +187,7 @@ if ($pre) {
                } else {
                        $pre =~ s/\.\*\$$//;
                }
+               $pre .= '$' if $exact;
                $expr = "\$f1 =~ m{$pre}";
                $pre =~ s/[\^\$]//g;
                $hint = "m{\U$pre}";