Fix sqlstring common
This commit is contained in:
parent
7c19408a63
commit
fd7d1a55a9
|
@ -106,17 +106,17 @@ sub new {
|
|||
bless $self, $class;
|
||||
|
||||
$self->{version} = '1.0';
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"sql-statement:s" => { name => 'sql_statement' },
|
||||
"key-column:s" => { name => 'key_column' },
|
||||
"value-column:s" => { name => 'value_column' },
|
||||
"warning-string:s" => { name => 'warning_string', default => '' },
|
||||
"critical-string:s" => { name => 'critical_string', default => '' },
|
||||
"printf-format:s" => { name => 'printf_format' },
|
||||
"printf-value:s" => { name => 'printf_value' },
|
||||
"dual-table" => { name => 'dual_table' },
|
||||
});
|
||||
$options{options}->add_options(arguments => {
|
||||
"sql-statement:s" => { name => 'sql_statement' },
|
||||
"key-column:s" => { name => 'key_column' },
|
||||
"value-column:s" => { name => 'value_column' },
|
||||
"warning-string:s" => { name => 'warning_string', default => '' },
|
||||
"critical-string:s" => { name => 'critical_string', default => '' },
|
||||
"printf-format:s" => { name => 'printf_format' },
|
||||
"printf-value:s" => { name => 'printf_value' },
|
||||
"dual-table" => { name => 'dual_table' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
@ -124,12 +124,12 @@ sub check_options {
|
|||
my ($self, %options) = @_;
|
||||
$self->SUPER::check_options(%options);
|
||||
|
||||
if (!defined($self->{instance_mode}->{option_results}->{sql_statement}) || $self->{instance_mode}->{option_results}->{sql_statement} eq '') {
|
||||
$self->{instance_mode}->{output}->add_option_msg(short_msg => "Need to specify '--sql-statement' option.");
|
||||
$self->{instance_mode}->{output}->option_exit();
|
||||
if (!defined($self->{option_results}->{sql_statement}) || $self->{option_results}->{sql_statement} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "Need to specify '--sql-statement' option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
||||
$self->{instance_mode}->change_macros(macros => ['warning_string', 'critical_string']);
|
||||
$self->change_macros(macros => ['warning_string', 'critical_string']);
|
||||
}
|
||||
|
||||
sub manage_selection {
|
||||
|
|
Loading…
Reference in New Issue