MCPcopy Create free account
hub / github.com/OpenVPN/openvpn3-linux / CheckExclusiveOptions

Method CheckExclusiveOptions

src/common/cmdargparser.cpp:231–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229//
230
231void ParsedArgs::CheckExclusiveOptions(const ExclusiveGroups &args_exclusive) const
232{
233 // Check if processed options is listed as an exclusive argument
234 for (const auto &arg : present)
235 {
236 for (const auto &group : args_exclusive)
237 {
238 // Is this argument listed in this group of exclusive args?
239 if (std::find(group.begin(), group.end(), arg) == group.end())
240 {
241 // Not found in this group, continue to next group
242 continue;
243 }
244
245 // This argument was found to be in an exclusiveness group.
246 // Now we need to see if any of the other arguments in this
247 // group has been used already.
248 for (const auto &x : group)
249 {
250 if (arg == x)
251 {
252 // Don't check against itself
253 continue;
254 }
255
256 // Check if any of the other options in this group in
257 // the exclusiveness list has been used already
258 if (std::find(present.begin(),
259 present.end(),
260 x)
261 != present.end())
262 {
263 throw ExclusiveOptionError(arg, group);
264 }
265 }
266 }
267 } // End of exclusiveness check
268}
269
270
271bool ParsedArgs::parse_bool_value(const std::string &k, const std::string &value) const

Callers 8

logger_serviceFunction · 0.45
cmd_netcfg_serviceFunction · 0.45
manage_config_fileFunction · 0.45
cmd_logFunction · 0.45
cmd_configs_listFunction · 0.45
NetCfgOptionsMethod · 0.45
TEST_FFunction · 0.45
devposture_proxyFunction · 0.45

Calls 1

Tested by 2

TEST_FFunction · 0.36
devposture_proxyFunction · 0.36