about summary refs log tree commit diff
path: root/src/nix/command.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/command.hh')
-rw-r--r--src/nix/command.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nix/command.hh b/src/nix/command.hh
index cf0097d78926..4800b5c912e4 100644
--- a/src/nix/command.hh
+++ b/src/nix/command.hh
@@ -118,6 +118,16 @@ public:
     bool useDefaultInstallables() override { return !all; }
 };
 
+/* A command that operates on exactly one store path. */
+struct StorePathCommand : public InstallablesCommand
+{
+    using StoreCommand::run;
+
+    virtual void run(ref<Store> store, const Path & storePath) = 0;
+
+    void run(ref<Store> store) override;
+};
+
 typedef std::map<std::string, ref<Command>> Commands;
 
 /* An argument parser that supports multiple subcommands,