about summary refs log tree commit diff
path: root/src/nix/command.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/command.cc')
-rw-r--r--src/nix/command.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nix/command.cc b/src/nix/command.cc
index a45f2888bfb5..3c82e0df57f7 100644
--- a/src/nix/command.cc
+++ b/src/nix/command.cc
@@ -129,4 +129,14 @@ void StorePathsCommand::run(ref<Store> store)
     run(store, storePaths);
 }
 
+void StorePathCommand::run(ref<Store> store)
+{
+    auto storePaths = buildInstallables(store, false);
+
+    if (storePaths.size() != 1)
+        throw UsageError("this command requires exactly one store path");
+
+    run(store, *storePaths.begin());
+}
+
 }