diff options
Diffstat (limited to 'src/nix/command.hh')
-rw-r--r-- | src/nix/command.hh | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/nix/command.hh b/src/nix/command.hh index a84721ccfa8c..8397244ca177 100644 --- a/src/nix/command.hh +++ b/src/nix/command.hh @@ -18,19 +18,36 @@ class Store; /* A command that require a Nix store. */ struct StoreCommand : virtual Command { - bool reserveSpace; - StoreCommand(bool reserveSpace = true) - : reserveSpace(reserveSpace) { }; + std::string storeUri; + StoreCommand(); void run() override; virtual void run(ref<Store>) = 0; }; +/* A command that operates on zero or more store paths. */ +struct StorePathsCommand : public StoreCommand +{ +private: + + Paths storePaths; + bool recursive = false; + +public: + + StorePathsCommand(); + + virtual void run(ref<Store> store, Paths storePaths) = 0; + + void run(ref<Store> store) override; +}; + typedef std::map<std::string, ref<Command>> Commands; /* An argument parser that supports multiple subcommands, i.e. ‘<command> <subcommand>’. */ -struct MultiCommand : virtual Args +class MultiCommand : virtual Args { +public: Commands commands; std::shared_ptr<Command> command; |