------------------------------------------------------------------------------------ */
| 727 | } |
| 728 | /* ------------------------------------------------------------------------------------ */ |
| 729 | Errata |
| 730 | Config::load_file_glob(TextView pattern, swoc::TextView cfg_key, YamlCache *cache) |
| 731 | { |
| 732 | int flags = 0; |
| 733 | glob_t files; |
| 734 | auto err_f = [](char const *, int) -> int { return 0; }; |
| 735 | swoc::file::path abs_pattern = ts::make_absolute(pattern); |
| 736 | int result = glob(abs_pattern.c_str(), flags, err_f, &files); |
| 737 | if (result == GLOB_NOMATCH) { |
| 738 | return Errata(S_WARN, R"(The pattern "{}" did not match any files.)", abs_pattern); |
| 739 | } |
| 740 | for (size_t idx = 0; idx < files.gl_pathc; ++idx) { |
| 741 | auto errata = this->load_file(swoc::file::path(files.gl_pathv[idx]), cfg_key, cache); |
| 742 | if (!errata.is_ok()) { |
| 743 | errata.note(R"(While processing pattern "{}".)", pattern); |
| 744 | return errata; |
| 745 | } |
| 746 | } |
| 747 | globfree(&files); |
| 748 | return {}; |
| 749 | } |
| 750 | /* ------------------------------------------------------------------------------------ */ |
| 751 | Errata |
| 752 | Config::load_cli_args(Handle handle, const std::vector<std::string> &args, int arg_idx, YamlCache *cache) |
no test coverage detected