From f1543bdf62cd0e6c80c0276ec6b0ec624b6ecfba Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Sat, 15 Mar 2025 15:39:07 -0700 Subject: [PATCH 1/4] RegisterCommand::Commands -> CommandMap This name is vague. Change-Id: I255e2d94a72193ca1a10f2abf4a3011c75ec9ecf --- lix/libcmd/command.cc | 15 ++++++++++----- lix/libcmd/command.hh | 8 ++++---- lix/libcmd/legacy.cc | 2 +- lix/libcmd/legacy.hh | 6 +++--- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/lix/libcmd/command.cc b/lix/libcmd/command.cc index 907734821..54502fd56 100644 --- a/lix/libcmd/command.cc +++ b/lix/libcmd/command.cc @@ -12,19 +12,24 @@ extern char * * environ __attribute__((weak)); namespace nix { -RegisterCommand::Commands * RegisterCommand::commands = nullptr; +RegisterCommand::CommandMap * RegisterCommand::commands = nullptr; nix::Commands RegisterCommand::getCommandsFor(const std::vector & prefix) { nix::Commands res; - for (auto & [name, command] : *RegisterCommand::commands) + for (auto & [name, command] : *RegisterCommand::commands) { if (name.size() == prefix.size() + 1) { bool equal = true; - for (size_t i = 0; i < prefix.size(); ++i) - if (name[i] != prefix[i]) equal = false; - if (equal) + for (size_t i = 0; i < prefix.size(); ++i) { + if (name[i] != prefix[i]) { + equal = false; + } + } + if (equal) { res.insert_or_assign(name[prefix.size()], command); + } } + } return res; } diff --git a/lix/libcmd/command.hh b/lix/libcmd/command.hh index 82ad562e5..c6fe424ff 100644 --- a/lix/libcmd/command.hh +++ b/lix/libcmd/command.hh @@ -264,16 +264,16 @@ struct StorePathCommand : public StorePathsCommand */ struct RegisterCommand { - typedef std::map< + using CommandMap = std::map< std::vector, std::function(AsyncIoRoot & aio)> - > Commands; - static Commands * commands; + >; + static CommandMap * commands; RegisterCommand(std::vector && name, std::function(AsyncIoRoot & aio)> command) { - if (!commands) commands = new Commands; + if (!commands) commands = new CommandMap; commands->emplace(name, command); } diff --git a/lix/libcmd/legacy.cc b/lix/libcmd/legacy.cc index 05ac2dcd4..4946d712b 100644 --- a/lix/libcmd/legacy.cc +++ b/lix/libcmd/legacy.cc @@ -2,6 +2,6 @@ namespace nix { -LegacyCommands::Commands * LegacyCommands::commands = 0; +LegacyCommands::LegacyCommandMap * LegacyCommands::commands = 0; } diff --git a/lix/libcmd/legacy.hh b/lix/libcmd/legacy.hh index ab1f1881d..b412b42dc 100644 --- a/lix/libcmd/legacy.hh +++ b/lix/libcmd/legacy.hh @@ -13,12 +13,12 @@ typedef std::function)> struct LegacyCommands { - typedef std::map Commands; - static Commands * commands; + using LegacyCommandMap = std::map; + static LegacyCommandMap * commands; static void add(const std::string & name, MainFunction fun) { - if (!commands) commands = new Commands; + if (!commands) commands = new LegacyCommandMap; (*commands)[name] = fun; } }; From 2ecbbc6e3356b961e5d26604f4fce20bcb1a20c1 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Sat, 15 Mar 2025 17:05:35 -0700 Subject: [PATCH 2/4] Commands -> CommandMap This name, for a different type, is also vague. Change-Id: I76405e940f3f1761bf0d66ba985d8c1dfc0b2d59 --- lix/libcmd/command.cc | 4 ++-- lix/libcmd/command.hh | 2 +- lix/libutil/args.cc | 2 +- lix/libutil/args.hh | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lix/libcmd/command.cc b/lix/libcmd/command.cc index 54502fd56..fb3daedcf 100644 --- a/lix/libcmd/command.cc +++ b/lix/libcmd/command.cc @@ -14,9 +14,9 @@ namespace nix { RegisterCommand::CommandMap * RegisterCommand::commands = nullptr; -nix::Commands RegisterCommand::getCommandsFor(const std::vector & prefix) +nix::CommandMap RegisterCommand::getCommandsFor(const std::vector & prefix) { - nix::Commands res; + nix::CommandMap res; for (auto & [name, command] : *RegisterCommand::commands) { if (name.size() == prefix.size() + 1) { bool equal = true; diff --git a/lix/libcmd/command.hh b/lix/libcmd/command.hh index c6fe424ff..e6c910915 100644 --- a/lix/libcmd/command.hh +++ b/lix/libcmd/command.hh @@ -277,7 +277,7 @@ struct RegisterCommand commands->emplace(name, command); } - static nix::Commands getCommandsFor(const std::vector & prefix); + static nix::CommandMap getCommandsFor(const std::vector & prefix); }; template diff --git a/lix/libutil/args.cc b/lix/libutil/args.cc index 67d91c09c..de98c4fcc 100644 --- a/lix/libutil/args.cc +++ b/lix/libutil/args.cc @@ -458,7 +458,7 @@ std::optional Command::experimentalFeature () return { Xp::NixCommand }; } -MultiCommand::MultiCommand(const Commands & commands_, bool allowExternal) +MultiCommand::MultiCommand(const CommandMap & commands_, bool allowExternal) : commands(commands_), customCommandSearchPaths( allowExternal ? tokenizeString( diff --git a/lix/libutil/args.hh b/lix/libutil/args.hh index 8a5026547..9c911a9df 100644 --- a/lix/libutil/args.hh +++ b/lix/libutil/args.hh @@ -350,7 +350,7 @@ struct Command : virtual public Args virtual Category category() { return catDefault; } }; -typedef std::map(AsyncIoRoot &)>> Commands; +using CommandMap = std::map(AsyncIoRoot &)>>; /** * An argument parser that supports multiple subcommands, @@ -359,7 +359,7 @@ typedef std::map(AsyncIoRoot &)>> Comman class MultiCommand : public Command { public: - Commands commands; + CommandMap commands; Strings customCommandSearchPaths; bool isExternalSubcommand; @@ -370,7 +370,7 @@ public: */ std::optional>> command; - MultiCommand(const Commands & commands, bool allowExternal = false); + MultiCommand(const CommandMap & commands, bool allowExternal = false); bool processFlag(Strings::iterator & pos, Strings::iterator end) override; From 53bf387022b0eaa46514a1974cf09efa60860450 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Sat, 15 Mar 2025 17:06:24 -0700 Subject: [PATCH 3/4] LegacyCommands -> LegacyCommandRegistry This name made sense at the time, but now I'm looking at making the corresponding change to `CommandRegistry`, and I don't think `Commands` is a good name for _that_ type, but I don't want the types to be mismatched, so here we are. Change-Id: I06068cbde00f49ff3d720c505a567a152b00b61c --- lix/legacy/build-remote.cc | 2 +- lix/legacy/nix-build.cc | 4 ++-- lix/legacy/nix-channel.cc | 2 +- lix/legacy/nix-collect-garbage.cc | 2 +- lix/legacy/nix-copy-closure.cc | 2 +- lix/legacy/nix-env.cc | 2 +- lix/legacy/nix-instantiate.cc | 2 +- lix/legacy/nix-store.cc | 2 +- lix/libcmd/legacy.cc | 2 +- lix/libcmd/legacy.hh | 2 +- lix/nix/daemon.cc | 2 +- lix/nix/hash.cc | 2 +- lix/nix/main.cc | 2 +- lix/nix/prefetch.cc | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lix/legacy/build-remote.cc b/lix/legacy/build-remote.cc index 85ff12976..07c26c8cd 100644 --- a/lix/legacy/build-remote.cc +++ b/lix/legacy/build-remote.cc @@ -395,7 +395,7 @@ connected: } void registerBuildRemote() { - LegacyCommands::add("build-remote", main_build_remote); + LegacyCommandRegistry::add("build-remote", main_build_remote); } } diff --git a/lix/legacy/nix-build.cc b/lix/legacy/nix-build.cc index 6bc6b1870..9fab226d9 100644 --- a/lix/legacy/nix-build.cc +++ b/lix/legacy/nix-build.cc @@ -634,8 +634,8 @@ static void main_nix_build(AsyncIoRoot & aio, std::string programName, Strings a } void registerNixBuildAndNixShell() { - LegacyCommands::add("nix-build", main_nix_build); - LegacyCommands::add("nix-shell", main_nix_build); + LegacyCommandRegistry::add("nix-build", main_nix_build); + LegacyCommandRegistry::add("nix-shell", main_nix_build); } } diff --git a/lix/legacy/nix-channel.cc b/lix/legacy/nix-channel.cc index c994e8583..caefbc637 100644 --- a/lix/legacy/nix-channel.cc +++ b/lix/legacy/nix-channel.cc @@ -279,7 +279,7 @@ static int main_nix_channel(AsyncIoRoot & aio, std::string programName, Strings } void registerNixChannel() { - LegacyCommands::add("nix-channel", main_nix_channel); + LegacyCommandRegistry::add("nix-channel", main_nix_channel); } } diff --git a/lix/legacy/nix-collect-garbage.cc b/lix/legacy/nix-collect-garbage.cc index 6ea7b7240..925463a81 100644 --- a/lix/legacy/nix-collect-garbage.cc +++ b/lix/legacy/nix-collect-garbage.cc @@ -113,7 +113,7 @@ static int main_nix_collect_garbage(AsyncIoRoot & aio, std::string programName, } void registerNixCollectGarbage() { - LegacyCommands::add("nix-collect-garbage", main_nix_collect_garbage); + LegacyCommandRegistry::add("nix-collect-garbage", main_nix_collect_garbage); } } diff --git a/lix/legacy/nix-copy-closure.cc b/lix/legacy/nix-copy-closure.cc index 811485cd7..0884dc1ef 100644 --- a/lix/legacy/nix-copy-closure.cc +++ b/lix/legacy/nix-copy-closure.cc @@ -62,7 +62,7 @@ static int main_nix_copy_closure(AsyncIoRoot & aio, std::string programName, Str } void registerNixCopyClosure() { - LegacyCommands::add("nix-copy-closure", main_nix_copy_closure); + LegacyCommandRegistry::add("nix-copy-closure", main_nix_copy_closure); } } diff --git a/lix/legacy/nix-env.cc b/lix/legacy/nix-env.cc index 74fb44fbf..0fe6565c3 100644 --- a/lix/legacy/nix-env.cc +++ b/lix/legacy/nix-env.cc @@ -1579,7 +1579,7 @@ static int main_nix_env(AsyncIoRoot & aio, std::string programName, Strings argv } void registerNixEnv() { - LegacyCommands::add("nix-env", main_nix_env); + LegacyCommandRegistry::add("nix-env", main_nix_env); } } diff --git a/lix/legacy/nix-instantiate.cc b/lix/legacy/nix-instantiate.cc index f8db06ef9..b8b64b276 100644 --- a/lix/legacy/nix-instantiate.cc +++ b/lix/legacy/nix-instantiate.cc @@ -197,7 +197,7 @@ static int main_nix_instantiate(AsyncIoRoot & aio, std::string programName, Stri } void registerNixInstantiate() { - LegacyCommands::add("nix-instantiate", main_nix_instantiate); + LegacyCommandRegistry::add("nix-instantiate", main_nix_instantiate); } } diff --git a/lix/legacy/nix-store.cc b/lix/legacy/nix-store.cc index 7eab7c69a..8b4418baa 100644 --- a/lix/legacy/nix-store.cc +++ b/lix/legacy/nix-store.cc @@ -1224,7 +1224,7 @@ static int main_nix_store(AsyncIoRoot & aio, std::string programName, Strings ar } void registerNixStore() { - LegacyCommands::add("nix-store", main_nix_store); + LegacyCommandRegistry::add("nix-store", main_nix_store); } } diff --git a/lix/libcmd/legacy.cc b/lix/libcmd/legacy.cc index 4946d712b..2c355f2e4 100644 --- a/lix/libcmd/legacy.cc +++ b/lix/libcmd/legacy.cc @@ -2,6 +2,6 @@ namespace nix { -LegacyCommands::LegacyCommandMap * LegacyCommands::commands = 0; +LegacyCommandRegistry::LegacyCommandMap * LegacyCommandRegistry::commands = 0; } diff --git a/lix/libcmd/legacy.hh b/lix/libcmd/legacy.hh index b412b42dc..068fb9eb9 100644 --- a/lix/libcmd/legacy.hh +++ b/lix/libcmd/legacy.hh @@ -11,7 +11,7 @@ namespace nix { typedef std::function)> MainFunction; -struct LegacyCommands +struct LegacyCommandRegistry { using LegacyCommandMap = std::map; static LegacyCommandMap * commands; diff --git a/lix/nix/daemon.cc b/lix/nix/daemon.cc index 2caf5ee58..489feb904 100644 --- a/lix/nix/daemon.cc +++ b/lix/nix/daemon.cc @@ -516,7 +516,7 @@ static int main_nix_daemon(AsyncIoRoot & aio, std::string programName, Strings a } void registerNixDaemon() { - LegacyCommands::add("nix-daemon", main_nix_daemon); + LegacyCommandRegistry::add("nix-daemon", main_nix_daemon); } struct CmdDaemon : StoreCommand diff --git a/lix/nix/hash.cc b/lix/nix/hash.cc index 2f3c40a39..cb85f7ce5 100644 --- a/lix/nix/hash.cc +++ b/lix/nix/hash.cc @@ -234,7 +234,7 @@ static int compatNixHash(AsyncIoRoot & aio, std::string programName, Strings arg } void registerNixHash() { - LegacyCommands::add("nix-hash", compatNixHash); + LegacyCommandRegistry::add("nix-hash", compatNixHash); } } diff --git a/lix/nix/main.cc b/lix/nix/main.cc index 6c7e48bad..6f3a73f89 100644 --- a/lix/nix/main.cc +++ b/lix/nix/main.cc @@ -389,7 +389,7 @@ void mainWrapped(AsyncIoRoot & aio, int argc, char * * argv) { registerLegacyCommands(); - auto legacy = (*LegacyCommands::commands)[programName]; + auto legacy = (*LegacyCommandRegistry::commands)[programName]; if (legacy) { return legacy(aio, std::string(baseNameOf(argv[0])), Strings(argv + 1, argv + argc)); } diff --git a/lix/nix/prefetch.cc b/lix/nix/prefetch.cc index 9d23c1d67..c99ffd008 100644 --- a/lix/nix/prefetch.cc +++ b/lix/nix/prefetch.cc @@ -256,7 +256,7 @@ static int main_nix_prefetch_url(AsyncIoRoot & aio, std::string programName, Str } void registerNixPrefetchUrl() { - LegacyCommands::add("nix-prefetch-url", main_nix_prefetch_url); + LegacyCommandRegistry::add("nix-prefetch-url", main_nix_prefetch_url); } struct CmdStorePrefetchFile : StoreCommand, MixJSON From d86b857505f543a5909c434ba19a36a29631be26 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Sat, 15 Mar 2025 17:45:49 -0700 Subject: [PATCH 4/4] registerNix* -> registerLegacyNix* Once I add `registerNixDaemon` and similar for the new-style commands, they'll conflict with the old `register*` functions, so let's add `legacy` to their names. Change-Id: I3fc0f15985abe43bc1f257be3ebd9021b66055a3 --- lix/legacy/build-remote.cc | 2 +- lix/legacy/build-remote.hh | 2 +- lix/legacy/nix-build.cc | 2 +- lix/legacy/nix-build.hh | 2 +- lix/legacy/nix-channel.cc | 2 +- lix/legacy/nix-channel.hh | 2 +- lix/legacy/nix-collect-garbage.cc | 2 +- lix/legacy/nix-collect-garbage.hh | 2 +- lix/legacy/nix-copy-closure.cc | 2 +- lix/legacy/nix-copy-closure.hh | 2 +- lix/legacy/nix-env.cc | 2 +- lix/legacy/nix-env.hh | 2 +- lix/legacy/nix-instantiate.cc | 2 +- lix/legacy/nix-instantiate.hh | 2 +- lix/legacy/nix-store.cc | 2 +- lix/legacy/nix-store.hh | 2 +- lix/nix/daemon-command.hh | 2 +- lix/nix/daemon.cc | 2 +- lix/nix/hash-command.hh | 2 +- lix/nix/hash.cc | 2 +- lix/nix/main.cc | 22 +++++++++++----------- lix/nix/prefetch-command.hh | 2 +- lix/nix/prefetch.cc | 2 +- 23 files changed, 33 insertions(+), 33 deletions(-) diff --git a/lix/legacy/build-remote.cc b/lix/legacy/build-remote.cc index 07c26c8cd..ea48e2423 100644 --- a/lix/legacy/build-remote.cc +++ b/lix/legacy/build-remote.cc @@ -394,7 +394,7 @@ connected: } } -void registerBuildRemote() { +void registerLegacyBuildRemote() { LegacyCommandRegistry::add("build-remote", main_build_remote); } diff --git a/lix/legacy/build-remote.hh b/lix/legacy/build-remote.hh index c4a35f706..b9296c178 100644 --- a/lix/legacy/build-remote.hh +++ b/lix/legacy/build-remote.hh @@ -3,6 +3,6 @@ namespace nix { -void registerBuildRemote(); +void registerLegacyBuildRemote(); } diff --git a/lix/legacy/nix-build.cc b/lix/legacy/nix-build.cc index 9fab226d9..ebaf4f37e 100644 --- a/lix/legacy/nix-build.cc +++ b/lix/legacy/nix-build.cc @@ -633,7 +633,7 @@ static void main_nix_build(AsyncIoRoot & aio, std::string programName, Strings a } } -void registerNixBuildAndNixShell() { +void registerLegacyNixBuildAndNixShell() { LegacyCommandRegistry::add("nix-build", main_nix_build); LegacyCommandRegistry::add("nix-shell", main_nix_build); } diff --git a/lix/legacy/nix-build.hh b/lix/legacy/nix-build.hh index 945ac06e2..d18bca616 100644 --- a/lix/legacy/nix-build.hh +++ b/lix/legacy/nix-build.hh @@ -3,6 +3,6 @@ namespace nix { -void registerNixBuildAndNixShell(); +void registerLegacyNixBuildAndNixShell(); } diff --git a/lix/legacy/nix-channel.cc b/lix/legacy/nix-channel.cc index caefbc637..0343dd7bd 100644 --- a/lix/legacy/nix-channel.cc +++ b/lix/legacy/nix-channel.cc @@ -278,7 +278,7 @@ static int main_nix_channel(AsyncIoRoot & aio, std::string programName, Strings } } -void registerNixChannel() { +void registerLegacyNixChannel() { LegacyCommandRegistry::add("nix-channel", main_nix_channel); } diff --git a/lix/legacy/nix-channel.hh b/lix/legacy/nix-channel.hh index f1583767f..1e0fc3f71 100644 --- a/lix/legacy/nix-channel.hh +++ b/lix/legacy/nix-channel.hh @@ -3,6 +3,6 @@ namespace nix { -void registerNixChannel(); +void registerLegacyNixChannel(); } diff --git a/lix/legacy/nix-collect-garbage.cc b/lix/legacy/nix-collect-garbage.cc index 925463a81..3d736e6cd 100644 --- a/lix/legacy/nix-collect-garbage.cc +++ b/lix/legacy/nix-collect-garbage.cc @@ -112,7 +112,7 @@ static int main_nix_collect_garbage(AsyncIoRoot & aio, std::string programName, } } -void registerNixCollectGarbage() { +void registerLegacyNixCollectGarbage() { LegacyCommandRegistry::add("nix-collect-garbage", main_nix_collect_garbage); } diff --git a/lix/legacy/nix-collect-garbage.hh b/lix/legacy/nix-collect-garbage.hh index 68515b537..ec542c3f2 100644 --- a/lix/legacy/nix-collect-garbage.hh +++ b/lix/legacy/nix-collect-garbage.hh @@ -3,6 +3,6 @@ namespace nix { -void registerNixCollectGarbage(); +void registerLegacyNixCollectGarbage(); } diff --git a/lix/legacy/nix-copy-closure.cc b/lix/legacy/nix-copy-closure.cc index 0884dc1ef..4f51b216a 100644 --- a/lix/legacy/nix-copy-closure.cc +++ b/lix/legacy/nix-copy-closure.cc @@ -61,7 +61,7 @@ static int main_nix_copy_closure(AsyncIoRoot & aio, std::string programName, Str } } -void registerNixCopyClosure() { +void registerLegacyNixCopyClosure() { LegacyCommandRegistry::add("nix-copy-closure", main_nix_copy_closure); } diff --git a/lix/legacy/nix-copy-closure.hh b/lix/legacy/nix-copy-closure.hh index fb5d0fc6e..b5c0b6acb 100644 --- a/lix/legacy/nix-copy-closure.hh +++ b/lix/legacy/nix-copy-closure.hh @@ -3,6 +3,6 @@ namespace nix { -void registerNixCopyClosure(); +void registerLegacyNixCopyClosure(); } diff --git a/lix/legacy/nix-env.cc b/lix/legacy/nix-env.cc index 0fe6565c3..fdfd6194b 100644 --- a/lix/legacy/nix-env.cc +++ b/lix/legacy/nix-env.cc @@ -1578,7 +1578,7 @@ static int main_nix_env(AsyncIoRoot & aio, std::string programName, Strings argv } } -void registerNixEnv() { +void registerLegacyNixEnv() { LegacyCommandRegistry::add("nix-env", main_nix_env); } diff --git a/lix/legacy/nix-env.hh b/lix/legacy/nix-env.hh index 47d62b8e6..6b0cc32df 100644 --- a/lix/legacy/nix-env.hh +++ b/lix/legacy/nix-env.hh @@ -3,6 +3,6 @@ namespace nix { -void registerNixEnv(); +void registerLegacyNixEnv(); } diff --git a/lix/legacy/nix-instantiate.cc b/lix/legacy/nix-instantiate.cc index b8b64b276..90c485bdf 100644 --- a/lix/legacy/nix-instantiate.cc +++ b/lix/legacy/nix-instantiate.cc @@ -196,7 +196,7 @@ static int main_nix_instantiate(AsyncIoRoot & aio, std::string programName, Stri } } -void registerNixInstantiate() { +void registerLegacyNixInstantiate() { LegacyCommandRegistry::add("nix-instantiate", main_nix_instantiate); } diff --git a/lix/legacy/nix-instantiate.hh b/lix/legacy/nix-instantiate.hh index f4c35a6b5..983dccbf2 100644 --- a/lix/legacy/nix-instantiate.hh +++ b/lix/legacy/nix-instantiate.hh @@ -3,6 +3,6 @@ namespace nix { -void registerNixInstantiate(); +void registerLegacyNixInstantiate(); } diff --git a/lix/legacy/nix-store.cc b/lix/legacy/nix-store.cc index 8b4418baa..ed54fe36c 100644 --- a/lix/legacy/nix-store.cc +++ b/lix/legacy/nix-store.cc @@ -1223,7 +1223,7 @@ static int main_nix_store(AsyncIoRoot & aio, std::string programName, Strings ar } } -void registerNixStore() { +void registerLegacyNixStore() { LegacyCommandRegistry::add("nix-store", main_nix_store); } diff --git a/lix/legacy/nix-store.hh b/lix/legacy/nix-store.hh index b010e7b19..a43fdebc8 100644 --- a/lix/legacy/nix-store.hh +++ b/lix/legacy/nix-store.hh @@ -3,6 +3,6 @@ namespace nix { -void registerNixStore(); +void registerLegacyNixStore(); } diff --git a/lix/nix/daemon-command.hh b/lix/nix/daemon-command.hh index 454af88e2..6cce1298c 100644 --- a/lix/nix/daemon-command.hh +++ b/lix/nix/daemon-command.hh @@ -3,6 +3,6 @@ namespace nix { -void registerNixDaemon(); +void registerLegacyNixDaemon(); } diff --git a/lix/nix/daemon.cc b/lix/nix/daemon.cc index 489feb904..b401c68cd 100644 --- a/lix/nix/daemon.cc +++ b/lix/nix/daemon.cc @@ -515,7 +515,7 @@ static int main_nix_daemon(AsyncIoRoot & aio, std::string programName, Strings a } } -void registerNixDaemon() { +void registerLegacyNixDaemon() { LegacyCommandRegistry::add("nix-daemon", main_nix_daemon); } diff --git a/lix/nix/hash-command.hh b/lix/nix/hash-command.hh index 5383171a5..2e1a8050f 100644 --- a/lix/nix/hash-command.hh +++ b/lix/nix/hash-command.hh @@ -3,6 +3,6 @@ namespace nix { -void registerNixHash(); +void registerLegacyNixHash(); } diff --git a/lix/nix/hash.cc b/lix/nix/hash.cc index cb85f7ce5..c5cde872e 100644 --- a/lix/nix/hash.cc +++ b/lix/nix/hash.cc @@ -233,7 +233,7 @@ static int compatNixHash(AsyncIoRoot & aio, std::string programName, Strings arg return 0; } -void registerNixHash() { +void registerLegacyNixHash() { LegacyCommandRegistry::add("nix-hash", compatNixHash); } diff --git a/lix/nix/main.cc b/lix/nix/main.cc index 6f3a73f89..2e5b23143 100644 --- a/lix/nix/main.cc +++ b/lix/nix/main.cc @@ -43,17 +43,17 @@ namespace nix { void registerLegacyCommands() { - registerNixEnv(); - registerNixBuildAndNixShell(); - registerNixInstantiate(); - registerNixCopyClosure(); - registerNixCollectGarbage(); - registerNixChannel(); - registerNixStore(); - registerBuildRemote(); - registerNixDaemon(); - registerNixPrefetchUrl(); - registerNixHash(); + registerLegacyNixEnv(); + registerLegacyNixBuildAndNixShell(); + registerLegacyNixInstantiate(); + registerLegacyNixCopyClosure(); + registerLegacyNixCollectGarbage(); + registerLegacyNixChannel(); + registerLegacyNixStore(); + registerLegacyBuildRemote(); + registerLegacyNixDaemon(); + registerLegacyNixPrefetchUrl(); + registerLegacyNixHash(); } static bool haveProxyEnvironmentVariables() diff --git a/lix/nix/prefetch-command.hh b/lix/nix/prefetch-command.hh index 078e83485..7a5e54de1 100644 --- a/lix/nix/prefetch-command.hh +++ b/lix/nix/prefetch-command.hh @@ -3,6 +3,6 @@ namespace nix { -void registerNixPrefetchUrl(); +void registerLegacyNixPrefetchUrl(); } diff --git a/lix/nix/prefetch.cc b/lix/nix/prefetch.cc index c99ffd008..3f7bae7f8 100644 --- a/lix/nix/prefetch.cc +++ b/lix/nix/prefetch.cc @@ -255,7 +255,7 @@ static int main_nix_prefetch_url(AsyncIoRoot & aio, std::string programName, Str } } -void registerNixPrefetchUrl() { +void registerLegacyNixPrefetchUrl() { LegacyCommandRegistry::add("nix-prefetch-url", main_nix_prefetch_url); }