2023-07-10 09:00:57 +02:00
|
|
|
// Copyright (C) 2023 The Syncthing Authors.
|
2018-09-09 15:52:59 +02: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-12 01:40:54 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
2024-09-21 09:10:24 +02:00
|
|
|
"log/slog"
|
2014-06-12 01:40:54 +02:00
|
|
|
"os"
|
2015-03-04 11:31:46 +01:00
|
|
|
|
2023-07-10 08:27:12 +02:00
|
|
|
"github.com/alecthomas/kong"
|
2024-09-21 09:04:22 +02:00
|
|
|
"github.com/syncthing/syncthing/cmd/infra/ursrv/serve"
|
2024-02-27 13:05:19 +01:00
|
|
|
_ "github.com/syncthing/syncthing/lib/automaxprocs"
|
2014-06-12 01:40:54 +02:00
|
|
|
)
|
|
|
|
|
2023-07-10 08:27:12 +02:00
|
|
|
type CLI struct {
|
2024-09-21 09:10:24 +02:00
|
|
|
Serve serve.CLI `cmd:"" default:""`
|
2015-03-04 11:31:46 +01:00
|
|
|
}
|
|
|
|
|
2014-06-12 01:40:54 +02:00
|
|
|
func main() {
|
2024-09-21 09:10:24 +02:00
|
|
|
slog.SetDefault(slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
|
|
|
|
Level: slog.LevelInfo,
|
|
|
|
})))
|
2015-03-04 11:31:46 +01:00
|
|
|
|
2023-07-10 08:27:12 +02:00
|
|
|
var cli CLI
|
2023-07-10 09:00:57 +02: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
|
|
|
}
|
|
|
|
}
|