main.go 904 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (C) 2023 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at https://mozilla.org/MPL/2.0/.
  6. package main
  7. import (
  8. "log"
  9. "os"
  10. "github.com/alecthomas/kong"
  11. "github.com/syncthing/syncthing/cmd/ursrv/aggregate"
  12. "github.com/syncthing/syncthing/cmd/ursrv/serve"
  13. "github.com/syncthing/syncthing/cmd/ursrv/servemetrics"
  14. _ "github.com/syncthing/syncthing/lib/automaxprocs"
  15. )
  16. type CLI struct {
  17. Serve serve.CLI `cmd:"" default:""`
  18. ServeMetrics servemetrics.CLI `cmd:""`
  19. Aggregate aggregate.CLI `cmd:""`
  20. }
  21. func main() {
  22. log.SetFlags(log.Ltime | log.Ldate | log.Lshortfile)
  23. log.SetOutput(os.Stdout)
  24. var cli CLI
  25. ctx := kong.Parse(&cli)
  26. if err := ctx.Run(); err != nil {
  27. log.Fatalf("%s: %v", ctx.Command(), err)
  28. }
  29. }