mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-27 00:06:16 +02:00
Add a "help" category
This makes the help commands show up prominently at the top of the 'nix' manpage.
This commit is contained in:
parent
233b063b08
commit
c967c29290
2 changed files with 6 additions and 0 deletions
|
@ -18,6 +18,7 @@ class EvalState;
|
||||||
struct Pos;
|
struct Pos;
|
||||||
class Store;
|
class Store;
|
||||||
|
|
||||||
|
static constexpr Command::Category catHelp = -1;
|
||||||
static constexpr Command::Category catSecondary = 100;
|
static constexpr Command::Category catSecondary = 100;
|
||||||
static constexpr Command::Category catUtility = 101;
|
static constexpr Command::Category catUtility = 101;
|
||||||
static constexpr Command::Category catNixInstallation = 102;
|
static constexpr Command::Category catNixInstallation = 102;
|
||||||
|
|
|
@ -65,6 +65,7 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs
|
||||||
NixArgs() : MultiCommand(RegisterCommand::getCommandsFor({})), MixCommonArgs("nix")
|
NixArgs() : MultiCommand(RegisterCommand::getCommandsFor({})), MixCommonArgs("nix")
|
||||||
{
|
{
|
||||||
categories.clear();
|
categories.clear();
|
||||||
|
categories[catHelp] = "Help commands";
|
||||||
categories[Command::catDefault] = "Main commands";
|
categories[Command::catDefault] = "Main commands";
|
||||||
categories[catSecondary] = "Infrequently used commands";
|
categories[catSecondary] = "Infrequently used commands";
|
||||||
categories[catUtility] = "Utility/scripting commands";
|
categories[catUtility] = "Utility/scripting commands";
|
||||||
|
@ -255,6 +256,8 @@ struct CmdHelp : Command
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Category category() override { return catHelp; }
|
||||||
|
|
||||||
void run() override
|
void run() override
|
||||||
{
|
{
|
||||||
assert(parent);
|
assert(parent);
|
||||||
|
@ -280,6 +283,8 @@ struct CmdHelpStores : Command
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Category category() override { return catHelp; }
|
||||||
|
|
||||||
void run() override
|
void run() override
|
||||||
{
|
{
|
||||||
showHelp({"help-stores"}, getNixArgs(*this));
|
showHelp({"help-stores"}, getNixArgs(*this));
|
||||||
|
|
Loading…
Reference in a new issue