2021-10-23 00:54:02 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2021-10-24 03:29:45 +02:00
|
|
|
"fmt"
|
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
"heckel.io/ntfy/cmd"
|
|
|
|
"os"
|
|
|
|
"runtime"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
version = "dev"
|
|
|
|
commit = "unknown"
|
|
|
|
date = "unknown"
|
2021-10-23 00:54:02 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2021-10-24 03:29:45 +02:00
|
|
|
cli.AppHelpTemplate += fmt.Sprintf(`
|
|
|
|
Try 'ntfy COMMAND --help' for more information.
|
|
|
|
|
|
|
|
ntfy %s (%s), runtime %s, built at %s
|
2021-12-17 02:33:01 +01:00
|
|
|
Copyright (C) 2021 Philipp C. Heckel, licensed under Apache License 2.0 & GPLv2
|
2021-10-24 03:29:45 +02:00
|
|
|
`, version, commit[:7], runtime.Version(), date)
|
|
|
|
|
|
|
|
app := cmd.New()
|
|
|
|
app.Version = version
|
|
|
|
|
|
|
|
if err := app.Run(os.Args); err != nil {
|
|
|
|
fmt.Fprintln(os.Stderr, err.Error())
|
|
|
|
os.Exit(1)
|
2021-10-23 00:54:02 +02:00
|
|
|
}
|
|
|
|
}
|