| 37 | // |
| 38 | |
| 39 | void 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 |
no test coverage detected