+// Command onechat runs the agent daemon and its terminal client.
package main
import (
case len(args) == 1 && (args[0] == "help" || args[0] == "--help" || args[0] == "-h"):
_, err := fmt.Print(usage)
if err != nil {
- return err
+ return fmt.Errorf("write command help: %w", err)
}
case len(args) == 1 && args[0] == "login":
err := chatgptLogin(ctx, os.Stdout)
if err != nil {
return err
}
+
// A signal is the normal stop of the daemon and the client, so their
// result does not include ctx.Err().
case len(args) == 1 && args[0] == "daemon":