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

Method ImportConfigFile

src/common/cmdargparser.cpp:39–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37//
38
39void ParsedArgs::ImportConfigFile(Configuration::File::Ptr config)
40{
41 for (const auto &opt : config->GetOptions())
42 {
43 // Check if this is an exclusive option
44 std::vector<std::string> related = config->GetRelatedExclusiveOptions(opt);
45 // Remove all the related exclusive options in the parsed args.
46 // The imported configuration file overrides the command line
47 // arguments
48 for (const auto &rel : related)
49 {
50 remove_arg(rel);
51 }
52
53 // Add/overwrite the argument/option from the configuration file
54 remove_arg(opt);
55 key_value[opt].push_back(config->GetValue(opt));
56 present.push_back(opt);
57 }
58}
59
60
61

Callers 2

logger_serviceFunction · 0.80
NetCfgOptionsMethod · 0.80

Calls 3

GetOptionsMethod · 0.80
GetValueMethod · 0.45

Tested by

no test coverage detected