mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-11 08:46:16 +02:00
33 lines
663 B
C++
33 lines
663 B
C++
#include "command.hh"
|
|
|
|
using namespace nix;
|
|
|
|
struct CmdNar : NixMultiCommand
|
|
{
|
|
CmdNar() : MultiCommand(RegisterCommand::getCommandsFor({"nar"}))
|
|
{ }
|
|
|
|
std::string description() override
|
|
{
|
|
return "create or inspect NAR files";
|
|
}
|
|
|
|
std::string doc() override
|
|
{
|
|
return
|
|
#include "nar.md"
|
|
;
|
|
}
|
|
|
|
Category category() override { return catUtility; }
|
|
|
|
void run() override
|
|
{
|
|
if (!command)
|
|
throw UsageError("'nix nar' requires a sub-command.");
|
|
command->second->prepare();
|
|
command->second->run();
|
|
}
|
|
};
|
|
|
|
static auto rCmdNar = registerCommand<CmdNar>("nar");
|