2023-07-10 07:00:57 +00:00
|
|
|
// Copyright (C) 2023 The Syncthing Authors.
|
2018-09-09 13:52:59 +00:00
|
|
|
//
|
|
|
|
// 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/.
|
|
|
|
|
2014-06-11 23:40:54 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"os"
|
2015-03-04 10:31:46 +00:00
|
|
|
|
2023-07-10 06:27:12 +00:00
|
|
|
"github.com/alecthomas/kong"
|
2023-07-10 07:00:57 +00:00
|
|
|
"github.com/syncthing/syncthing/cmd/ursrv/aggregate"
|
|
|
|
"github.com/syncthing/syncthing/cmd/ursrv/serve"
|
2024-02-27 12:05:19 +00:00
|
|
|
_ "github.com/syncthing/syncthing/lib/automaxprocs"
|
2014-06-11 23:40:54 +00:00
|
|
|
)
|
|
|
|
|
2023-07-10 06:27:12 +00:00
|
|
|
type CLI struct {
|
2023-07-10 07:00:57 +00:00
|
|
|
Serve serve.CLI `cmd:"" default:""`
|
|
|
|
Aggregate aggregate.CLI `cmd:""`
|
2015-03-04 10:31:46 +00:00
|
|
|
}
|
|
|
|
|
2014-06-11 23:40:54 +00:00
|
|
|
func main() {
|
2017-10-25 07:26:13 +00:00
|
|
|
log.SetFlags(log.Ltime | log.Ldate | log.Lshortfile)
|
2014-12-07 14:48:48 +00:00
|
|
|
log.SetOutput(os.Stdout)
|
2015-03-04 10:31:46 +00:00
|
|
|
|
2023-07-10 06:27:12 +00:00
|
|
|
var cli CLI
|
2023-07-10 07:00:57 +00:00
|
|
|
ctx := kong.Parse(&cli)
|
|
|
|
if err := ctx.Run(); err != nil {
|
|
|
|
log.Fatalf("%s: %v", ctx.Command(), err)
|
2017-11-09 22:22:47 +00:00
|
|
|
}
|
|
|
|
}
|