serve: make the servers self registering

This is so that they can import cmd/serve without causing an import
loop.

The active servers can now be configured by commenting lines out in
cmd/all/all.go like all the other commands.
This commit is contained in:
Nick Craig-Wood
2025-04-09 11:12:07 +01:00
parent 084e35c49d
commit df457f5802
11 changed files with 28 additions and 34 deletions
+2
View File
@@ -19,6 +19,7 @@ import (
"github.com/anacrolix/dms/upnp"
"github.com/anacrolix/log"
"github.com/rclone/rclone/cmd"
"github.com/rclone/rclone/cmd/serve"
"github.com/rclone/rclone/cmd/serve/dlna/data"
"github.com/rclone/rclone/cmd/serve/dlna/dlnaflags"
"github.com/rclone/rclone/fs"
@@ -32,6 +33,7 @@ import (
func init() {
dlnaflags.AddFlags(Command.Flags())
vfsflags.AddFlags(Command.Flags())
serve.Command.AddCommand(Command)
}
// Command definition for cobra.