syncthing/cmd/ursrv/main.go

34 lines
795 B
Go
Raw Normal View History

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