aboutsummaryrefslogtreecommitdiff
path: root/src/nix/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/main.cc')
-rw-r--r--src/nix/main.cc30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/nix/main.cc b/src/nix/main.cc
index 4a3a7b4e7..fdd3ac2ae 100644
--- a/src/nix/main.cc
+++ b/src/nix/main.cc
@@ -15,6 +15,17 @@
#include "markdown.hh"
#include "experimental-features-json.hh"
#include "deprecated-features-json.hh"
+#include "build-remote.hh"
+#include "daemon-command.hh"
+#include "hash-command.hh"
+#include "nix-build.hh"
+#include "nix-channel.hh"
+#include "nix-collect-garbage.hh"
+#include "nix-copy-closure.hh"
+#include "nix-env.hh"
+#include "nix-instantiate.hh"
+#include "nix-store.hh"
+#include "prefetch-command.hh"
#include <sys/types.h>
#include <sys/socket.h>
@@ -30,6 +41,21 @@ void chrootHelper(int argc, char * * argv);
namespace nix {
+void registerLegacyCommands()
+{
+ registerNixEnv();
+ registerNixBuildAndNixShell();
+ registerNixInstantiate();
+ registerNixCopyClosure();
+ registerNixCollectGarbage();
+ registerNixChannel();
+ registerNixStore();
+ registerBuildRemote();
+ registerNixDaemon();
+ registerNixPrefetchUrl();
+ registerNixHash();
+}
+
static bool haveProxyEnvironmentVariables()
{
static const std::vector<std::string> proxyVariables = {
@@ -356,8 +382,10 @@ void mainWrapped(int argc, char * * argv)
// Clean up the progress bar if shown using --log-format in a legacy command too.
// Otherwise, this is a harmless no-op.
Finally f([] { logger->pause(); });
+
{
- auto legacy = (*RegisterLegacyCommand::commands)[programName];
+ registerLegacyCommands();
+ auto legacy = (*LegacyCommands::commands)[programName];
if (legacy) return legacy(argc, argv);
}