main.go 795 B

12345678910111213141516171819202122232425262728293031323334
  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/lib/automaxprocs"
  14. )
  15. type CLI struct {
  16. Serve serve.CLI `cmd:"" default:""`
  17. Aggregate aggregate.CLI `cmd:""`
  18. }
  19. func main() {
  20. log.SetFlags(log.Ltime | log.Ldate | log.Lshortfile)
  21. log.SetOutput(os.Stdout)
  22. var cli CLI
  23. ctx := kong.Parse(&cli)
  24. if err := ctx.Run(); err != nil {
  25. log.Fatalf("%s: %v", ctx.Command(), err)
  26. }
  27. }