diff options
author | Gavin Carr <gonzai@users.sourceforge.net> | 2007-03-21 00:52:56 +0000 |
---|---|---|
committer | Gavin Carr <gonzai@users.sourceforge.net> | 2007-03-21 00:52:56 +0000 |
commit | dc31f1cd3841d486e920e59ce42e888ca94e4289 (patch) | |
tree | 14bcc87e8349b99b01a649f27429690321fc21f9 /lib/Nagios/Plugin/Functions.pm | |
parent | c6cbf050974c8f6642fa1d7bde309710b66cbfa0 (diff) | |
download | monitoring-plugin-perl-dc31f1cd3841d486e920e59ce42e888ca94e4289.tar.gz |
Finished initial --extra-opts support; added Getopt spec-to-help and multiline help support.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1643 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'lib/Nagios/Plugin/Functions.pm')
-rw-r--r-- | lib/Nagios/Plugin/Functions.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Nagios/Plugin/Functions.pm b/lib/Nagios/Plugin/Functions.pm index 526dbed..751251f 100644 --- a/lib/Nagios/Plugin/Functions.pm +++ b/lib/Nagios/Plugin/Functions.pm | |||
@@ -46,6 +46,13 @@ our %STATUS_TEXT = reverse %ERRORS; | |||
46 | my $_fake_exit = 0; | 46 | my $_fake_exit = 0; |
47 | sub _fake_exit { @_ ? $_fake_exit = shift : $_fake_exit }; | 47 | sub _fake_exit { @_ ? $_fake_exit = shift : $_fake_exit }; |
48 | 48 | ||
49 | # Tweak default die handling: die is cool because it allows capturing both return codes and | ||
50 | # output via eval, but the Nagios Plugin Guidelines like STDOUT over STDERR | ||
51 | $SIG{__DIE__} = sub { | ||
52 | print STDOUT shift; | ||
53 | exit $!; | ||
54 | }; | ||
55 | |||
49 | sub get_shortname { | 56 | sub get_shortname { |
50 | my %arg = @_; | 57 | my %arg = @_; |
51 | 58 | ||
@@ -390,7 +397,6 @@ This code is maintained by the Nagios Plugin Development Team: http://nagiosplug | |||
390 | Copyright (C) 2006 by Nagios Plugin Development Team | 397 | Copyright (C) 2006 by Nagios Plugin Development Team |
391 | 398 | ||
392 | This library is free software; you can redistribute it and/or modify | 399 | This library is free software; you can redistribute it and/or modify |
393 | it under the same terms as Perl itself, either Perl version 5.8.4 or, | 400 | it under the same terms as Perl itself. |
394 | at your option, any later version of Perl 5 you may have available. | ||
395 | 401 | ||
396 | =cut | 402 | =cut |