summaryrefslogtreecommitdiff
path: root/cmd/do/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/do/main.go')
-rw-r--r--cmd/do/main.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/cmd/do/main.go b/cmd/do/main.go
new file mode 100644
index 0000000..afab992
--- /dev/null
+++ b/cmd/do/main.go
@@ -0,0 +1,22 @@
+package main
+
+import (
+ "context"
+ "fmt"
+ "os"
+
+ "codeberg.org/snonux/hexai/internal/askcli"
+)
+
+func main() {
+ d := askcli.NewDispatcher(nil)
+ code, err := d.Dispatch(context.Background(), os.Args[1:], os.Stdin, os.Stdout, os.Stderr)
+ if err != nil {
+ // Print the internal error so callers get a useful diagnostic message.
+ fmt.Fprintln(os.Stderr, err)
+ os.Exit(code)
+ }
+ if code != 0 {
+ os.Exit(code)
+ }
+}