# HG changeset patch # User Matthias Förste # Date 1306222839 -7200 # Node ID 5a51a3757f5e7cfcb335c5cc77e1b709af1c5c3f # Parent c76989cccf622a5eec72e5fc2ec5e989e1346335 fixed -m for systems without perldoc diff -r c76989cccf62 -r 5a51a3757f5e dnsnagios/check_dnssec --- a/dnsnagios/check_dnssec Mon May 23 14:41:49 2011 +0200 +++ b/dnsnagios/check_dnssec Tue May 24 09:40:39 2011 +0200 @@ -48,14 +48,23 @@ UNKNOWN => 3 }; +sub version($$); + Getopt::Long::Configure('no_ignore_case_always'); + GetOptions( "w|warning=i" => \$opt->{warning}, "c|critical=i" => \$opt->{critical}, "H|index-host=s" => \$opt->{'index-host'}, "Z|index-zone=s" => \$opt->{'index-zone'}, "h|help" => sub { pod2usage( -verbose => 1, -exitval => $rv->{OK} ) }, - "m|man" => sub { pod2usage( -verbose => 2, -exitval => $rv->{OK} ) }, + "m|man" => sub { pod2usage( + -exitval => $rv->{OK}, + # "system('perldoc -V &>/dev/null')" appears shorter, but may not + # do what you expect ( it still returns 0 on debian squeeze with + # dash as system shell even if cannot find the command in $PATH) + -noperldoc => system('perldoc -V >/dev/null 2>&1'), + -verbose => 2 ) }, "V|version" => sub { version( $ME, $VERSION ); exit $rv->{OK}; } ) or pod2usage( -verbose => 1, -exitval => $rv->{CRITICAL} );