X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/3af849e2045f7c580d4c533d829dc9d567162d36..f5730918ef684baafbd9e606a1d4eb06914563cc:/src/src/exiqgrep.src diff --git a/src/src/exiqgrep.src b/src/src/exiqgrep.src index c4f7c4b58..0661c5792 100644 --- a/src/src/exiqgrep.src +++ b/src/src/exiqgrep.src @@ -2,6 +2,8 @@ # Utility for searching and displaying queue information. # Written by Matt Hubbard 15 August 2002 +# +# Copyright (c) The Exim Maintainers 2021 - 2022 # Except when they appear in comments, the following placeholders in this # source are replaced when it is turned into a runnable script: @@ -53,11 +55,14 @@ if ($ARGV[0] eq '--version') { exit 0; } -getopts('hf:r:y:o:s:C:zxlibRca',\%opt); -if ($ARGV[0]) { &help; exit;} -if ($opt{h}) { &help; exit;} +if (!getopts('hf:r:y:o:s:C:zxlibRcaG:E:',\%opt)) { &help; exit; } +if ($opt{h}) { &help; exit; } +if ($ARGV[0] || !($opt{f} || $opt{r} || $opt{s} || $opt{y} || $opt{o} || $opt{z} || $opt{x} || $opt{c})) + { &help; exit(1); } 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}; } +if ($opt{E}) { $exim = $opt{E}; } # Read message queue output into hash &collect(); @@ -74,6 +79,7 @@ Exim message queue display utility. -h This help message. -C Specify which exim.conf to use. + -E Specify exim binary to use. Selection criteria: -f Match sender address sender (field is "< >" wrapped) @@ -83,6 +89,7 @@ Selection criteria: -o Message older than -z Frozen messages only (exclude non-frozen) -x Non-frozen messages only (exclude frozen) + -G Match in given queue only [ NB: for regexps, provided string sits in // ]