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.hh20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/nix/command.hh b/src/nix/command.hh
index b159408c3a98..479e6fd3742f 100644
--- a/src/nix/command.hh
+++ b/src/nix/command.hh
@@ -51,7 +51,7 @@ struct Installable
 {
     virtual std::string what() = 0;
 
-    virtual Buildables toBuildable()
+    virtual Buildables toBuildable(bool singular = false)
     {
         throw Error("argument '%s' cannot be built", what());
     }
@@ -97,8 +97,6 @@ struct InstallablesCommand : virtual Args, SourceExprCommand
         expectArgs("installables", &_installables);
     }
 
-    std::vector<std::shared_ptr<Installable>> parseInstallables(ref<Store> store, Strings ss);
-
     enum ToStorePathsMode { Build, NoBuild, DryRun };
 
     PathSet toStorePaths(ref<Store> store, ToStorePathsMode mode);
@@ -112,6 +110,22 @@ private:
     Strings _installables;
 };
 
+struct InstallableCommand : virtual Args, SourceExprCommand
+{
+    std::shared_ptr<Installable> installable;
+
+    InstallableCommand()
+    {
+        expectArg("installable", &_installable);
+    }
+
+    void prepare() override;
+
+private:
+
+    std::string _installable;
+};
+
 /* A command that operates on zero or more store paths. */
 struct StorePathsCommand : public InstallablesCommand
 {