Import Upstream version 4.92
[hcoop/debian/exim4.git] / src / exiqgrep.src
index afecbff..c4f7c4b 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';
@@ -43,7 +46,15 @@ if ($^O eq 'darwin') { # aka MacOS X
   $base = 62;
 };
 
+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:zxlibRca',\%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}; }
@@ -86,7 +97,7 @@ EOF
 }
 
 sub collect() {
-       open(QUEUE,"$exim $eargs |") or die("Error openning pipe: $!\n");
+       open(QUEUE,"$exim $eargs |") or die("Error opening pipe: $!\n");
        while(<QUEUE>) {
                chomp();
                my $line = $_;