mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 07:34:35 +02:00
+ Add global version
This commit is contained in:
parent
af71ac763e
commit
89c8f254c5
@ -29,7 +29,9 @@ use FindBin;
|
|||||||
use Pod::Usage;
|
use Pod::Usage;
|
||||||
use Pod::Find qw(pod_where);
|
use Pod::Find qw(pod_where);
|
||||||
|
|
||||||
my %handlers = ('DIE' => {});
|
my %handlers = (DIE => {});
|
||||||
|
|
||||||
|
my $global_version = 20151110;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
@ -242,6 +244,10 @@ sub run {
|
|||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
if (!defined($self->{plugin}) || $self->{plugin} eq '') {
|
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}->add_option_msg(short_msg => "Need to specify '--plugin' option.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
@ -285,7 +291,7 @@ Print available plugins.
|
|||||||
|
|
||||||
=item B<--version>
|
=item B<--version>
|
||||||
|
|
||||||
Print plugin version.
|
Print global version.
|
||||||
|
|
||||||
=item B<--help>
|
=item B<--help>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user