-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
45 lines (38 loc) · 964 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
37
38
39
40
41
42
43
44
45
package main
import (
"context"
"os"
"os/signal"
"time"
"github.com/friendly-fhir/fhenix/internal/cobra/cmd"
"github.com/friendly-fhir/fhenix/internal/snek"
)
var (
version = "snapshot"
date string
)
const (
defaultTimeout = time.Minute * 2
)
func main() {
date, err := time.Parse(time.RFC3339, date)
if err != nil {
date = time.Now()
}
root := cmd.RootCommand{}
app := snek.NewApplication(&root, &snek.AppInfo{
Website: "https://friendly-fhir.org",
DocsURL: "https://friendly-fhir.org/fhenix",
ReportIssueURL: "https://github.com/friendly-fhir/fhenix/issues",
KeyTerms: []string{"fhenix.yaml"},
Variables: []string{"fhenix config", "fhir registry"},
Version: version,
Date: date,
})
ctx := context.Background()
ctx, stop := signal.NotifyContext(ctx, os.Interrupt)
defer stop()
ctx, cancel := context.WithTimeout(ctx, defaultTimeout)
defer cancel()
app.Execute(ctx).Exit()
}