-
Notifications
You must be signed in to change notification settings - Fork 26
/
main.go
36 lines (30 loc) · 833 Bytes
/
main.go
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
// pcopy is a temporary file host, nopaste and clipboard across machines. It can be used from the
// Web UI, via a CLI or without a client by using curl.
//
// Full documentation with examples and videos can be found at https://heckel.io/pcopy.
package main
import (
"fmt"
"github.com/urfave/cli/v2"
"heckel.io/pcopy/cmd"
"os"
"runtime"
)
var (
version = "dev"
commit = "unknown"
date = "unknown"
)
func main() {
cli.AppHelpTemplate += fmt.Sprintf(`
Try 'pcopy COMMAND --help' for more information.
pcopy %s (%s), runtime %s, built at %s
Copyright (C) 2021 Philipp C. Heckel, distributed under the Apache License 2.0
`, version, commit[:7], runtime.Version(), date)
app := cmd.New()
app.Version = version
if err := cmd.Run(app, os.Args...); err != nil {
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(1)
}
}