-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
33 lines (27 loc) · 731 Bytes
/
main.go
File metadata and controls
33 lines (27 loc) · 731 Bytes
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
package main
import (
"context"
"os"
"os/signal"
"github.com/DanStough/fang"
"github.com/DanStough/epok/internal/buildinfo"
"github.com/DanStough/epok/internal/cmd"
"github.com/DanStough/epok/internal/styles"
)
func main() {
if err := execute(); err != nil {
os.Exit(1)
}
}
// execute adds all child commands to the root command and sets flags appropriately.
func execute() error {
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill)
defer stop()
rootCmd := cmd.NewRootCMD()
theme := styles.NewEpokTheme()
return fang.Execute(ctx, rootCmd,
fang.WithCommit(buildinfo.GetCommit()),
fang.WithVersion(buildinfo.GetVersion()),
fang.WithColorSchemeFunc(theme.FangColorScheme),
)
}