+// Command onechat runs the agent daemon and its terminal client.
package main
import (
func main() {
err := run()
if err != nil {
- fmt.Fprintln(os.Stderr, "onechat:", err)
+ // A failed error report cannot be reported through the same
+ // stream.
+ fmt.Fprintln(os.Stderr, "onechat:", err) // nolint: errcheck
os.Exit(1)
}
}
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer cancel()
- _, err := fmt.Println("onechat")
- if err != nil {
- return err
- }
-
- return ctx.Err()
+ return parseCommand(ctx, os.Args[1:])
}