2020-07-24 18:42:24 +00:00
|
|
|
#include "command.hh"
|
|
|
|
|
|
|
|
using namespace nix;
|
|
|
|
|
|
|
|
struct CmdNar : NixMultiCommand
|
|
|
|
{
|
|
|
|
CmdNar() : MultiCommand(RegisterCommand::getCommandsFor({"nar"}))
|
|
|
|
{ }
|
|
|
|
|
|
|
|
std::string description() override
|
|
|
|
{
|
2020-12-09 18:21:48 +00:00
|
|
|
return "create or inspect NAR files";
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string doc() override
|
|
|
|
{
|
|
|
|
return
|
|
|
|
#include "nar.md"
|
|
|
|
;
|
2020-07-24 18:42:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Category category() override { return catUtility; }
|
|
|
|
|
|
|
|
void run() override
|
|
|
|
{
|
|
|
|
if (!command)
|
|
|
|
throw UsageError("'nix nar' requires a sub-command.");
|
|
|
|
command->second->run();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static auto rCmdNar = registerCommand<CmdNar>("nar");
|