diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-02-24 15:28:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-24 15:28:19 +0100 |
commit | 199081ad00e6ee4c704eaac34211b454fe0f310c (patch) | |
tree | 0d6d62aaa13ace160111c1c9580a9a7ccc6ba818 /src/nix | |
parent | a878c448d84f087ee1dfdde95a51614187aa170c (diff) | |
parent | f6c5b05488c588964f51ce97ad2c297fbca7ce96 (diff) |
Merge pull request #4486 from shlevy/command-plugins-v2
Command plugins
Diffstat (limited to 'src/nix')
-rw-r--r-- | src/nix/daemon.cc | 2 | ||||
-rw-r--r-- | src/nix/main.cc | 8 | ||||
-rw-r--r-- | src/nix/prefetch.cc | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/nix/daemon.cc b/src/nix/daemon.cc index 26006167d..2cf2a04c9 100644 --- a/src/nix/daemon.cc +++ b/src/nix/daemon.cc @@ -326,8 +326,6 @@ static int main_nix_daemon(int argc, char * * argv) return true; }); - initPlugins(); - runDaemon(stdio); return 0; diff --git a/src/nix/main.cc b/src/nix/main.cc index 1b68cf15b..06e221682 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -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) @@ -283,8 +289,6 @@ void mainWrapped(int argc, char * * argv) if (completions) return; - initPlugins(); - if (args.showVersion) { printVersion(programName); return; diff --git a/src/nix/prefetch.cc b/src/nix/prefetch.cc index a831dcd15..b7da3ea5a 100644 --- a/src/nix/prefetch.cc +++ b/src/nix/prefetch.cc @@ -171,8 +171,6 @@ static int main_nix_prefetch_url(int argc, char * * argv) myArgs.parseCmdline(argvToStrings(argc, argv)); - initPlugins(); - if (args.size() > 2) throw UsageError("too many arguments"); |