diff --git a/aegisub/src/command/command.cpp b/aegisub/src/command/command.cpp index 86fce7993..e40d719e4 100644 --- a/aegisub/src/command/command.cpp +++ b/aegisub/src/command/command.cpp @@ -64,6 +64,14 @@ namespace cmd { } } + std::vector get_registered_commands() { + std::vector ret; + ret.reserve(cmd_map.size()); + for (iterator it = cmd_map.begin(); it != cmd_map.end(); ++it) + ret.push_back(it->first); + return ret; + } + // These forward declarations exist here since we don't want to expose // them in a header, they're strictly internal-use. void init_app(); diff --git a/aegisub/src/command/command.h b/aegisub/src/command/command.h index 0d2ab0c6c..6a995fe88 100644 --- a/aegisub/src/command/command.h +++ b/aegisub/src/command/command.h @@ -153,6 +153,9 @@ namespace cmd { /// @param Command object. Command* get(std::string const& name); + /// Get a list of registered command names + std::vector get_registered_commands(); + /// Unregister and deletes all commands void clear(); } // namespace cmd