aboutsummaryrefslogtreecommitdiff
path: root/cmd/ursrv/main.go
blob: 25bdb0446ed94182bf5071969ae5b8113d3254fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (C) 2023 The Syncthing Authors.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at https://mozilla.org/MPL/2.0/.

package main

import (
	"log"
	"os"

	"github.com/alecthomas/kong"
	"github.com/syncthing/syncthing/cmd/ursrv/aggregate"
	"github.com/syncthing/syncthing/cmd/ursrv/serve"
)

type CLI struct {
	Serve     serve.CLI     `cmd:"" default:""`
	Aggregate aggregate.CLI `cmd:""`
}

func main() {
	log.SetFlags(log.Ltime | log.Ldate | log.Lshortfile)
	log.SetOutput(os.Stdout)

	var cli CLI
	ctx := kong.Parse(&cli)
	if err := ctx.Run(); err != nil {
		log.Fatalf("%s: %v", ctx.Command(), err)
	}
}