This commit is contained in:
Quentin Garnier 2014-09-30 16:50:06 +02:00
parent 42cf4f4d28
commit f2321264d5
1 changed files with 14 additions and 6 deletions

View File

@ -93,12 +93,13 @@ sub get_plugin {
$self->{options}->set_output(output => $self->{output});
$self->{options}->add_options(arguments => {
'plugin:s' => { name => 'plugin' },
'list-plugin' => { name => 'list_plugin' },
'help' => { name => 'help' },
'version' => { name => 'version' },
'runas:s' => { name => 'runas' },
'environment:s%' => { name => 'environment' },
'plugin:s' => { name => 'plugin' },
'list-plugin' => { name => 'list_plugin' },
'help' => { name => 'help' },
'ignore-warn-msg' => { name => 'ignore_warn_msg' },
'version' => { name => 'version' },
'runas:s' => { name => 'runas' },
'environment:s%' => { name => 'environment' },
} );
$self->{options}->parse_options();
@ -249,6 +250,9 @@ sub run {
$self->{output}->add_option_msg(short_msg => "Need to specify '--plugin' option.");
$self->{output}->option_exit();
}
if (defined($self->{ignore_warn_msg})) {
$SIG{__WARN__} = sub {};
}
$self->check_relaunch();
@ -292,6 +296,10 @@ Print plugin version.
Print a brief help message and exits.
=item B<--ignore-warn-msg>
Perl warn messages are ignored (not displayed).
=item B<--runas>
Run the script as a different user (prefer to use directly the good user).