2026-05-02 10:37:38 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2026-11-20 04:13:05 +00:00
|
|
|
"context"
|
2026-05-02 10:37:38 -05:00
|
|
|
"os"
|
2026-11-20 05:53:49 +00:00
|
|
|
"os/signal"
|
|
|
|
|
"syscall"
|
2026-05-02 10:37:38 -05:00
|
|
|
|
2026-11-20 04:13:05 +00:00
|
|
|
"go.maximumdirect.net/commandkit"
|
|
|
|
|
|
2026-05-02 10:37:38 -05:00
|
|
|
"gitea.maximumdirect.net/eric/narratio/internal/app"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2026-11-20 05:53:49 +00:00
|
|
|
os.Exit(runProcess(os.Args[1:], commandkit.Streams{Out: os.Stdout, Err: os.Stderr}, app.Execute))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func runProcess(args []string, streams commandkit.Streams, execute func(context.Context, []string, commandkit.Streams) commandkit.Outcome) int {
|
|
|
|
|
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
|
|
|
|
defer stop()
|
|
|
|
|
return execute(ctx, args, streams).Status
|
2026-05-02 10:37:38 -05:00
|
|
|
}
|