nix dump-path: Add

This is primarily useful for extracting NARs from other stores (like
binary caches), which "nix-store --dump" cannot do.
This commit is contained in:
Eelco Dolstra 2017-05-04 14:16:26 +02:00
parent 44309c5067
commit 2da6a42448
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 55 additions and 0 deletions

View file

@ -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,