debian's 32_exim4.dpatch
[exim.git] / src / src / exiqgrep.src
index ae617c4e1c16330ab77edb48e06dcf82e8e55dfd..bd95ae83642a0ed4d9a8c3af905a5feba1f8580d 100644 (file)
 # Version 1.2
 
 use strict;
+BEGIN { pop @INC if $INC[-1] eq '.' };
+
 use Getopt::Std;
+use File::Basename;
 
 # Have this variable point to your exim binary.
-my $exim = 'BIN_DIRECTORY/exim';
+my $exim = 'BIN_DIRECTORY/exim4';
 my $eargs = '-bpu';
 my %id;
 my %opt;
@@ -43,11 +46,19 @@ if ($^O eq 'darwin') { # aka MacOS X
   $base = 62;
 };
 
-getopts('hf:r:y:o:s:C:zxlibRca',\%opt);
+if ($ARGV[0] eq '--version') {
+    print basename($0) . ": $0\n",
+        "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION\n",
+        "perl(runtime): $]\n";
+        exit 0;
+}
+
+getopts('hf:r:y:o:s:C:zxlibRcaG:',\%opt);
 if ($ARGV[0]) { &help; exit;}
 if ($opt{h}) { &help; exit;}
 if ($opt{a}) { $eargs = '-bp'; }
 if ($opt{C} && -e $opt{C} && -f $opt{C} && -R $opt{C}) { $eargs .= ' -C '.$opt{C}; }
+if ($opt{G}) { $eargs .= ' -qG'.$opt{G}; }
 
 # Read message queue output into hash
 &collect();
@@ -73,6 +84,7 @@ Selection criteria:
        -o <seconds>    Message older than
        -z              Frozen messages only (exclude non-frozen)
        -x              Non-frozen messages only (exclude frozen)
+       -G <queuename>  Match in given queue only
 
 [ NB: for regexps, provided string sits in /<string>/ ]