mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-14 10:16:15 +02:00
27 lines
581 B
C++
27 lines
581 B
C++
|
#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();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
static auto rCmdStore = registerCommand<CmdStore>("store");
|