main.go 742 B

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