mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
Introduce 'nix store' command
This commit is contained in:
parent
5781f45c46
commit
79c1967ded
1 changed files with 31 additions and 0 deletions
31
src/nix/store.cc
Normal file
31
src/nix/store.cc
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
#include "command.hh"
|
||||||
|
|
||||||
|
using namespace nix;
|
||||||
|
|
||||||
|
struct CmdStore : virtual NixMultiCommand
|
||||||
|
{
|
||||||
|
CmdStore() : MultiCommand(RegisterCommand::getCommandsFor({"store"}))
|
||||||
|
{ }
|
||||||
|
|
||||||
|
std::string description() override
|
||||||
|
{
|
||||||
|
return "manipulate a Nix store";
|
||||||
|
}
|
||||||
|
|
||||||
|
Category category() override { return catUtility; }
|
||||||
|
|
||||||
|
void run() override
|
||||||
|
{
|
||||||
|
if (!command)
|
||||||
|
throw UsageError("'nix store' requires a sub-command.");
|
||||||
|
command->second->prepare();
|
||||||
|
command->second->run();
|
||||||
|
}
|
||||||
|
|
||||||
|
void printHelp(const string & programName, std::ostream & out) override
|
||||||
|
{
|
||||||
|
MultiCommand::printHelp(programName, out);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static auto rCmdStore = registerCommand<CmdStore>("store");
|
Loading…
Reference in a new issue