-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
32 lines (25 loc) · 870 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
package main
import (
"context"
"flag"
"os"
"github.com/google/subcommands"
_ "github.com/joho/godotenv/autoload"
tsm_app "github.com/ZipFile/twitch-stream-monitor/internal/app"
tsm_cli "github.com/ZipFile/twitch-stream-monitor/internal/cli"
)
func main() {
app := tsm_app.New()
subcommands.Register(subcommands.HelpCommand(), "")
subcommands.Register(subcommands.FlagsCommand(), "")
subcommands.Register(subcommands.CommandsCommand(), "")
subcommands.Register(tsm_cli.NewMonitor(app), "")
subcommands.Register(tsm_cli.NewSubscribe(app), "")
subcommands.Register(tsm_cli.NewUnsubscribe(app), "")
subcommands.Register(tsm_cli.NewGetAppAccessToken(app), "")
subcommands.Register(tsm_cli.NewResolveUsername(app), "")
subcommands.Register(tsm_cli.NewList(app), "")
flag.Parse()
ctx := context.Background()
os.Exit(int(subcommands.Execute(ctx)))
}