X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fexipick.src;h=da6dbec02de174af9d24ad05a2f8d7644e9bc506;hb=2b2cfa838f206b5d97a120722861f42780bc6a6a;hp=a2281f0da17417a6a018d192cd40e8c6f6f1f83a;hpb=48ab0b3cd8203744bd9f50765a81473bbbb93de1;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/exipick.src b/src/src/exipick.src index a2281f0da..da6dbec02 100644 --- a/src/src/exipick.src +++ b/src/src/exipick.src @@ -18,10 +18,11 @@ use strict; BEGIN { pop @INC if $INC[-1] eq '.' }; use Getopt::Long; use File::Basename; +use Pod::Usage; -my($p_name) = $0 =~ m|/?([^/]+)$|; +my $p_name = basename $0; my $p_version = "20100323.0"; -my $p_usage = "Usage: $p_name [--help|--version] (see --help for details)"; +my $p_usage = "Usage: $p_name [--help|--man|--version] (see --help for details)"; my $p_cp = < @@ -39,7 +40,6 @@ my $p_cp = < \$G::just_vars, # only display vars, no other info 'show-rules' => \$G::show_rules, # display compiled match rules 'show-tests' => \$G::show_tests, # display tests as applied to each message + 'man' => sub { pod2usage(-verbose => 2, -exit => 0, -noperldoc => system('perldoc -V >/dev/null 2>&1')) }, + 'help' => sub { pod2usage(-verbose => 1, -exit => 0) }, 'version' => sub { - print basename($0) . ": $0\n", + print "$p_name: $0\n", "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION\n", "perl(runtime): $]\n"; exit 0; }, -) || exit(1); +) or pod2usage; # if both freeze and thaw specified, only thaw as it is less destructive $G::freeze = undef if ($G::freeze && $G::thaw); @@ -1266,34 +1268,16 @@ sub dump { } # BEGIN -sub ext_usage { - if ($ARGV[0] =~ /^--help$/i) { - require Config; - $ENV{PATH} .= ":" unless $ENV{PATH} eq ""; - $ENV{PATH} = "$ENV{PATH}$Config::Config{'installscript'}"; - #exec("perldoc", "-F", "-U", $0) || exit 1; - $< = $> = 1 if ($> == 0 || $< == 0); - exec("perldoc", $0) || exit 1; - # make parser happy - %Config::Config = (); - } elsif ($ARGV[0] =~ /^--version$/i) { - print "$p_name version $p_version\n\n$p_cp\n"; - } else { - return; - } - - exit(0); -} - __END__ =head1 NAME -exipick - selectively display messages from an Exim queue + exipick - selectively display messages from an Exim queue =head1 SYNOPSIS -exipick [] [ [ ...]] + exipick [] [ [ ...]] + exipick --help|--man =head1 DESCRIPTION