diff options
Diffstat (limited to '')
-rw-r--r-- | src/dump_internals.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/dump_internals.cc b/src/dump_internals.cc index 8317769..fe4904d 100644 --- a/src/dump_internals.cc +++ b/src/dump_internals.cc @@ -29,6 +29,7 @@ #include "dump_internals.hh" +#include "bound_tags.hh" #include "lnav.events.hh" #include "lnav.hh" #include "lnav_config.hh" @@ -42,6 +43,9 @@ namespace lnav { void dump_internals(const char* internals_dir) { + static const auto* sql_cmd_map + = injector::get<readline_context::command_map_t*, sql_cmd_map_tag>(); + for (const auto* handlers : std::initializer_list<const json_path_container*>{ &lnav_config_handlers, @@ -77,16 +81,23 @@ dump_internals(const char* internals_dir) auto sql_ref_path = ghc::filesystem::path(internals_dir) / "sql-ref.rst"; auto sql_file = std::unique_ptr<FILE, decltype(&fclose)>( fopen(sql_ref_path.c_str(), "w+"), fclose); - std::set<help_text*> unique_sql_help; + std::set<const help_text*> unique_sql_help; if (sql_file != nullptr) { - for (auto& sql : sqlite_function_help) { + for (const auto& sql : sqlite_function_help) { if (unique_sql_help.find(sql.second) != unique_sql_help.end()) { continue; } unique_sql_help.insert(sql.second); format_help_text_for_rst(*sql.second, eval_example, sql_file.get()); } + for (const auto& cmd_pair : *sql_cmd_map) { + if (cmd_pair.second->c_help.ht_name == nullptr) { + continue; + } + format_help_text_for_rst( + cmd_pair.second->c_help, eval_example, sql_file.get()); + } } } |