]> git.giacomolli.uk - onechat/blob - main.go
Require consent and review for autosquash
[onechat] / main.go
1 // Command onechat runs the agent daemon and its terminal client.
2 package main
3
4 import (
5 "context"
6 "fmt"
7 "os"
8 "os/signal"
9 "syscall"
10 )
11
12 func main() {
13 err := run()
14 if err != nil {
15 // A failed error report cannot be reported through the same
16 // stream.
17 fmt.Fprintln(os.Stderr, "onechat:", err) // nolint: errcheck
18 os.Exit(1)
19 }
20 }
21
22 func run() error {
23 ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
24 defer cancel()
25
26 return parseCommand(ctx, os.Args[1:])
27 }