mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-28 16:46:16 +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
389 B
C++
18 lines
389 B
C++
#include "command.hh"
|
|
|
|
using namespace nix;
|
|
|
|
struct CmdStore : NixMultiCommand
|
|
{
|
|
CmdStore() : NixMultiCommand("store", RegisterCommand::getCommandsFor({"store"}))
|
|
{ }
|
|
|
|
std::string description() override
|
|
{
|
|
return "manipulate a Nix store";
|
|
}
|
|
|
|
Category category() override { return catUtility; }
|
|
};
|
|
|
|
static auto rCmdStore = registerCommand<CmdStore>("store");
|