mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 15:26:17 +02:00
Respect command registrations in plugins.
This commit is contained in:
parent
98d1b64400
commit
f6c5b05488
3 changed files with 9 additions and 2 deletions
|
@ -5,3 +5,4 @@
|
|||
to any command, including a subcommand to `nix`. For example,
|
||||
`nix-instantiate default.nix --plugin-files ""` must now become
|
||||
`nix-instantiate --plugin-files "" default.nix`.
|
||||
- Plugins that add new `nix` subcommands are now actually respected.
|
||||
|
|
|
@ -306,8 +306,8 @@ Strings argvToStrings(int argc, char * * argv)
|
|||
return args;
|
||||
}
|
||||
|
||||
MultiCommand::MultiCommand(const Commands & commands)
|
||||
: commands(commands)
|
||||
MultiCommand::MultiCommand(const Commands & commands_)
|
||||
: commands(commands_)
|
||||
{
|
||||
expectArgs({
|
||||
.label = "subcommand",
|
||||
|
|
|
@ -159,6 +159,12 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs
|
|||
#include "nix.md"
|
||||
;
|
||||
}
|
||||
|
||||
// Plugins may add new subcommands.
|
||||
void pluginsInited() override
|
||||
{
|
||||
commands = RegisterCommand::getCommandsFor({});
|
||||
}
|
||||
};
|
||||
|
||||
static void showHelp(std::vector<std::string> subcommand)
|
||||
|
|
Loading…
Reference in a new issue