aboutsummaryrefslogtreecommitdiff
path: root/src/nix/store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/store.cc')
-rw-r--r--src/nix/store.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/nix/store.cc b/src/nix/store.cc
new file mode 100644
index 000000000..44e53c7c7
--- /dev/null
+++ b/src/nix/store.cc
@@ -0,0 +1,26 @@
+#include "command.hh"
+
+using namespace nix;
+
+struct CmdStore : virtual NixMultiCommand
+{
+ CmdStore() : MultiCommand(RegisterCommand::getCommandsFor({"store"}))
+ { }
+
+ std::string description() override
+ {
+ return "manipulate a Nix store";
+ }
+
+ Category category() override { return catUtility; }
+
+ void run() override
+ {
+ if (!command)
+ throw UsageError("'nix store' requires a sub-command.");
+ command->second->prepare();
+ command->second->run();
+ }
+};
+
+static auto rCmdStore = registerCommand<CmdStore>("store");