summaryrefslogtreecommitdiff
path: root/absl/flags/reflection.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/flags/reflection.cc')
-rw-r--r--absl/flags/reflection.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/absl/flags/reflection.cc b/absl/flags/reflection.cc
index e4145b34..d7060221 100644
--- a/absl/flags/reflection.cc
+++ b/absl/flags/reflection.cc
@@ -303,5 +303,15 @@ CommandLineFlag* FindCommandLineFlag(absl::string_view name) {
return registry.FindFlagLocked(name);
}
+// --------------------------------------------------------------------
+
+absl::flat_hash_map<absl::string_view, absl::CommandLineFlag*> GetAllFlags() {
+ absl::flat_hash_map<absl::string_view, absl::CommandLineFlag*> res;
+ flags_internal::ForEachFlag([&](CommandLineFlag& flag) {
+ res.insert({flag.Name(), &flag});
+ });
+ return res;
+}
+
ABSL_NAMESPACE_END
} // namespace absl