bool HostDownLimitOption::validate( const variables_map& vm ) const
{
- bool is_valid = ( vm.count( get_command_string() ) > 0 );
+ bool is_valid = ( 1 <= vm.count( get_command_string() ) );
return is_valid;
}
)
{
// hosts-down-limit
- if ( vm.count( get_command_string() ) > 0 )
+ if ( 1 <= vm.count( get_command_string() ) )
{
int host_down_limit = vm[ get_command_string() ].as<int> ();
configuration->set_hosts_down_limit( host_down_limit );
bool parsed_success = false;
// [host] name
- if ( vm.count( get_command_string() ) > 0 )
+ if ( 1 <= vm.count( get_command_string() ) )
{
HostList hosts_list;
bool HostPingIntervalOption::validate( const variables_map& vm ) const
{
- bool is_valid = ( vm.count( get_command_string() ) > 0 );
+ bool is_valid = ( 1 <= vm.count( get_command_string() ) );
return is_valid;
}
bool HostPingProtocolOption::validate( const variables_map& vm ) const
{
- bool is_valid = ( vm.count( get_command_string() ) > 0 );
+ bool is_valid = ( 1 <= vm.count( get_command_string() ) );
return is_valid;
}
bool HostPortOption::validate( const variables_map& vm ) const
{
- bool is_valid = ( vm.count( get_command_string() ) > 0 );
+ bool is_valid = ( 1 <= vm.count( get_command_string() ) );
return is_valid;
}
bool LinkDownIntervalOption::validate( const variables_map& vm ) const
{
- bool is_valid = ( vm.count( get_command_string() ) > 0 );
+ bool is_valid = ( 1 <= vm.count( get_command_string() ) );
return is_valid;
}
)
{
// link-down-interval
- if ( vm.count( get_command_string() ) > 0 )
+ if ( 1 <= vm.count( get_command_string() ) )
{
int link_down_interval_in_min = vm[ get_command_string() ].as<int>();
configuration->set_link_down_interval_in_min( link_down_interval_in_min );
bool LinkUpIntervalOption::validate( const variables_map& vm ) const
{
- bool is_valid = ( vm.count( get_command_string() ) > 0 );
+ bool is_valid = ( 1 <= vm.count( get_command_string() ) );
return is_valid;
}
)
{
// link-up-interval
- if ( vm.count( get_command_string() ) > 0 )
+ if ( 1 <= vm.count( get_command_string() ) )
{
int link_up_interval_in_min = vm[ get_command_string() ].as<int>();
configuration->set_link_up_interval_in_min( link_up_interval_in_min );
bool NameserverOption::validate( const variables_map& vm ) const
{
- bool is_valid = ( vm.count( get_command_string() ) > 0 );
+ bool is_valid = ( 1 <= vm.count( get_command_string() ) );
return is_valid;
}
)
{
// nameserver
- if ( vm.count( get_command_string() ) > 0 )
+ if ( 1 <= vm.count( get_command_string() ) )
{
string nameserver = vm[ get_command_string() ].as<string> ();
configuration->set_nameserver( nameserver );
bool PingFailLimitOption::validate( const variables_map& vm ) const
{
- bool is_valid = ( vm.count( get_command_string() ) > 0 );
+ bool is_valid = ( 1 <= vm.count( get_command_string() ) );
return is_valid;
}
)
{
// ping-fail-limit
- if ( vm.count( get_command_string() ) > 0 )
+ if ( 1 <= vm.count( get_command_string() ) )
{
int ping_fail_limit = vm[ get_command_string() ].as<int> ();
configuration->set_ping_fail_limit( ping_fail_limit );
bool SourceNetworkInterfaceOption::validate( const variables_map& vm ) const
{
// TODO validate if it is a valid interface
- bool is_valid = ( vm.count( get_command_string() ) > 0 );
+ bool is_valid = ( 1 <= vm.count( get_command_string() ) );
return is_valid;
}
)
{
// source-network-interface
- if ( vm.count( get_command_string() ) > 0 )
+ if ( 1 <= vm.count( get_command_string() ) )
{
string source_network_interface = vm[ get_command_string() ].as<string> ();
configuration->set_source_network_interface( source_network_interface );
bool StatusNotifierCmdOption::validate( const variables_map& vm ) const
{
- bool is_valid = ( vm.count( get_command_string() ) > 0 );
+ bool is_valid = ( 1 <= vm.count( get_command_string() ) );
return is_valid;
}
)
{
// status-notifier-cmd
- if ( vm.count( get_command_string() ) > 0 )
+ if ( 1 <= vm.count( get_command_string() ) )
{
string status_notifier_cmd = vm[ get_command_string() ].as<string>();
configuration->set_status_notifier_cmd( status_notifier_cmd );