#pragma once #include #include #include namespace nix { typedef std::function MainFunction; struct RegisterLegacyCommand { using Commands = std::map; static Commands* commands; RegisterLegacyCommand(const std::string& name, MainFunction fun) { if (!commands) { commands = new Commands; } (*commands)[name] = fun; } }; } // namespace nix