From e9c07a3b26a1e3056538a8fce49c9f7d9f1d8aba Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 29 Aug 2017 16:18:00 +0200 Subject: nix edit / log: Operate on a single Installable --- src/nix/command.hh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/nix/command.hh') 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> parseInstallables(ref store, Strings ss); - enum ToStorePathsMode { Build, NoBuild, DryRun }; PathSet toStorePaths(ref store, ToStorePathsMode mode); @@ -112,6 +110,22 @@ private: Strings _installables; }; +struct InstallableCommand : virtual Args, SourceExprCommand +{ + std::shared_ptr 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 { -- cgit 1.4.1