-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
39 lines (32 loc) · 648 Bytes
/
main.go
File metadata and controls
39 lines (32 loc) · 648 Bytes
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
33
34
35
36
37
38
39
package main
import (
"errors"
"log"
"os"
"github.com/jpillora/cloud-torrent/server"
"github.com/jpillora/opts"
)
var VERSION = "0.0.0-src" //set with ldflags
func main() {
s := server.Server{
Title: "SimpleTorrent",
Port: 3000,
}
o := opts.New(&s)
o.Version(VERSION)
o.Repo("https://github.com/boypt/simple-torrent")
o.PkgRepo()
o.SetLineWidth(96)
o.Parse()
if s.DisableLogTime {
log.SetFlags(0)
}
log.Printf("############# SimpleTorrent ver[%s] #############\n", VERSION)
if err := s.Run(VERSION); err != nil {
if errors.Is(err, server.ErrDiskSpace) {
log.Println(err)
os.Exit(42)
}
log.Fatal(err)
}
}