diff options
author | jade <lix@jade.fyi> | 2024-10-09 20:37:58 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@localhost> | 2024-10-09 20:37:58 +0000 |
commit | 9865ebaaa618d82a7b7fdccc636cbaa7dfa42427 (patch) | |
tree | b79db30394a892e7e6b7e0a2f966081b4a366590 /src/libcmd/legacy.hh | |
parent | 7f7a38f2788ba7fa46cf38127f525700cf63e153 (diff) | |
parent | b63d4a0c622fa556695e7666b9b3bde920904920 (diff) |
Merge "Remove static initializers for `RegisterLegacyCommand`" into main
Diffstat (limited to 'src/libcmd/legacy.hh')
-rw-r--r-- | src/libcmd/legacy.hh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcmd/legacy.hh b/src/libcmd/legacy.hh index 357500a4d..45a231983 100644 --- a/src/libcmd/legacy.hh +++ b/src/libcmd/legacy.hh @@ -9,12 +9,12 @@ namespace nix { typedef std::function<void(int, char * *)> MainFunction; -struct RegisterLegacyCommand +struct LegacyCommands { typedef std::map<std::string, MainFunction> Commands; static Commands * commands; - RegisterLegacyCommand(const std::string & name, MainFunction fun) + static void add(const std::string & name, MainFunction fun) { if (!commands) commands = new Commands; (*commands)[name] = fun; |