Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): support retrieving configuration fields using glob patterns #2592

Merged
merged 6 commits into from
Oct 12, 2024
Merged
3 changes: 2 additions & 1 deletion src/config/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <utility>
#include <vector>

#include "common/string_util.h"
#include "config_type.h"
#include "config_util.h"
#include "parse_util.h"
Expand Down Expand Up @@ -867,7 +868,7 @@ Status Config::Load(const CLIOptions &opts) {
void Config::Get(const std::string &key, std::vector<std::string> *values) const {
values->clear();
for (const auto &iter : fields_) {
if (key == "*" || util::ToLower(key) == iter.first) {
if (util::StringMatch(key, iter.first, 1)) {
if (iter.second->IsMultiConfig()) {
for (const auto &p : util::Split(iter.second->ToString(), "\n")) {
values->emplace_back(iter.first);
Expand Down
Loading