-
Notifications
You must be signed in to change notification settings - Fork 58
/
cli.go
43 lines (38 loc) · 845 Bytes
/
cli.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
37
38
39
40
41
42
43
package main
import (
"fmt"
"os"
"github.com/gotify/cli/v2/command"
"github.com/gotify/cli/v2/utils"
"gopkg.in/urfave/cli.v1"
)
var (
// Version the version of Gotify-CLI.
Version = "unknown"
// Commit the git commit hash of this version.
Commit = "unknown"
// BuildDate the date on which this binary was build.
BuildDate = "unknown"
)
func main() {
cli.VersionPrinter = versionPrinter
app := cli.NewApp()
app.Name = "Gotify"
app.Version = Version
app.Usage = "The official Gotify-CLI"
app.Commands = []cli.Command{
command.Init(),
command.Version(),
command.Config(),
command.Push(),
}
err := app.Run(os.Args)
if err != nil {
utils.Exit1With(err)
}
}
func versionPrinter(ctx *cli.Context) {
fmt.Println("Version: " + Version)
fmt.Println("Commit: " + Commit)
fmt.Println("BuildDate: " + BuildDate)
}