dropshell release 2025.0524.2033
Some checks failed
Dropshell Test / Build_and_Test (push) Failing after 11s

This commit is contained in:
Your Name
2025-05-24 20:33:55 +12:00
parent a5243a7e79
commit bcc78859fc
3 changed files with 14 additions and 5 deletions

View File

@ -20,6 +20,15 @@ void CommandRegistry::register_command(const CommandInfo& info) {
const CommandInfo* CommandRegistry::find_command(const std::string& name) const {
auto it = command_map_.find(name);
if (it != command_map_.end()) return it->second.get();
// go deep now.
for (const auto& cmd : all_commands_) {
if (cmd->names.size() > 0) {
for (const auto& altname : cmd->names) {
if (name == altname) return cmd.get();
}
}
}
return nullptr;
}