From 89c8f254c550c00ee4f125a42be89380f92d957c Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 10 Nov 2015 11:16:11 +0100 Subject: [PATCH] + Add global version --- centreon/plugins/script.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/centreon/plugins/script.pm b/centreon/plugins/script.pm index 81df96169..7cf310f13 100644 --- a/centreon/plugins/script.pm +++ b/centreon/plugins/script.pm @@ -29,7 +29,9 @@ use FindBin; use Pod::Usage; use Pod::Find qw(pod_where); -my %handlers = ('DIE' => {}); +my %handlers = (DIE => {}); + +my $global_version = 20151110; sub new { my $class = shift; @@ -242,6 +244,10 @@ sub run { $self->{output}->option_exit(); } if (!defined($self->{plugin}) || $self->{plugin} eq '') { + if (defined($self->{version})) { + $self->{output}->add_option_msg(short_msg => "Global Version: " . $global_version); + $self->{output}->option_exit(nolabel => 1); + } $self->{output}->add_option_msg(short_msg => "Need to specify '--plugin' option."); $self->{output}->option_exit(); } @@ -285,7 +291,7 @@ Print available plugins. =item B<--version> -Print plugin version. +Print global version. =item B<--help>