main.go 839 B

123456789101112131415161718192021222324252627282930313233343536
  1. package main
  2. import (
  3. "fmt"
  4. "github.com/urfave/cli/v2"
  5. "heckel.io/ntfy/v2/cmd"
  6. "os"
  7. "runtime"
  8. )
  9. var (
  10. version = "dev"
  11. commit = "unknown"
  12. date = "unknown"
  13. )
  14. func main() {
  15. cli.AppHelpTemplate += fmt.Sprintf(`
  16. Try 'ntfy COMMAND --help' or https://ntfy.sh/docs/ for more information.
  17. To report a bug, open an issue on GitHub: https://github.com/binwiederhier/ntfy/issues.
  18. If you want to chat, simply join the Discord server (https://discord.gg/cT7ECsZj9w), or
  19. the Matrix room (https://matrix.to/#/#ntfy:matrix.org).
  20. ntfy %s (%s), runtime %s, built at %s
  21. Copyright (C) 2022 Philipp C. Heckel, licensed under Apache License 2.0 & GPLv2
  22. `, version, commit[:7], runtime.Version(), date)
  23. app := cmd.New()
  24. app.Version = version
  25. if err := app.Run(os.Args); err != nil {
  26. fmt.Fprintln(os.Stderr, err.Error())
  27. os.Exit(1)
  28. }
  29. }