mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-02-01 07:56:47 +02:00
7fff625e39
* Factor out the default `MultiCommand` behavior All the `MultiCommand`s had (nearly) the same behavior when called without a subcommand. Factor out this behavior into the `NixMultiCommand` class. * Display the list of available subcommands when none is specified Whenever a user runs a command that excepts a subcommand, add the list of available subcommands to the error message. * Print the multi-command lists as Markdown lists This takes more screen real estate, but is also much more readable than a comma-separated list
18 lines
454 B
C++
18 lines
454 B
C++
#include "command.hh"
|
|
|
|
using namespace nix;
|
|
|
|
struct CmdDerivation : NixMultiCommand
|
|
{
|
|
CmdDerivation() : NixMultiCommand("derivation", RegisterCommand::getCommandsFor({"derivation"}))
|
|
{ }
|
|
|
|
std::string description() override
|
|
{
|
|
return "Work with derivations, Nix's notion of a build plan.";
|
|
}
|
|
|
|
Category category() override { return catUtility; }
|
|
};
|
|
|
|
static auto rCmdDerivation = registerCommand<CmdDerivation>("derivation");
|