Fix #5850
This commit is contained in:
parent
42cf4f4d28
commit
f2321264d5
|
@ -93,12 +93,13 @@ sub get_plugin {
|
||||||
$self->{options}->set_output(output => $self->{output});
|
$self->{options}->set_output(output => $self->{output});
|
||||||
|
|
||||||
$self->{options}->add_options(arguments => {
|
$self->{options}->add_options(arguments => {
|
||||||
'plugin:s' => { name => 'plugin' },
|
'plugin:s' => { name => 'plugin' },
|
||||||
'list-plugin' => { name => 'list_plugin' },
|
'list-plugin' => { name => 'list_plugin' },
|
||||||
'help' => { name => 'help' },
|
'help' => { name => 'help' },
|
||||||
'version' => { name => 'version' },
|
'ignore-warn-msg' => { name => 'ignore_warn_msg' },
|
||||||
'runas:s' => { name => 'runas' },
|
'version' => { name => 'version' },
|
||||||
'environment:s%' => { name => 'environment' },
|
'runas:s' => { name => 'runas' },
|
||||||
|
'environment:s%' => { name => 'environment' },
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$self->{options}->parse_options();
|
$self->{options}->parse_options();
|
||||||
|
@ -249,6 +250,9 @@ sub run {
|
||||||
$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();
|
||||||
}
|
}
|
||||||
|
if (defined($self->{ignore_warn_msg})) {
|
||||||
|
$SIG{__WARN__} = sub {};
|
||||||
|
}
|
||||||
|
|
||||||
$self->check_relaunch();
|
$self->check_relaunch();
|
||||||
|
|
||||||
|
@ -292,6 +296,10 @@ Print plugin version.
|
||||||
|
|
||||||
Print a brief help message and exits.
|
Print a brief help message and exits.
|
||||||
|
|
||||||
|
=item B<--ignore-warn-msg>
|
||||||
|
|
||||||
|
Perl warn messages are ignored (not displayed).
|
||||||
|
|
||||||
=item B<--runas>
|
=item B<--runas>
|
||||||
|
|
||||||
Run the script as a different user (prefer to use directly the good user).
|
Run the script as a different user (prefer to use directly the good user).
|
||||||
|
|
Loading…
Reference in New Issue