Exiqgrep: check arg parsing. Bug 2821
[exim.git] / src / src / exiqgrep.src
index c26da684bfae3f136c9414930df73e6ec68a615b..04602da680c62f41eb6cd5caeb655ea383d64ef7 100644 (file)
@@ -49,15 +49,16 @@ if ($^O eq 'darwin') { # aka MacOS X
 if ($ARGV[0] eq '--version') {
     print basename($0) . ": $0\n",
         "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION\n",
-        "perl(runtime): $^V\n";
+        "perl(runtime): $]\n";
         exit 0;
 }
 
-getopts('hf:r:y:o:s:C:zxlibRca',\%opt);
+if (!getopts('hf:r:y:o:s:C:zxlibRcaG:',\%opt) { &help; exit;}
 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();
@@ -83,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>/ ]