Files
scriptorium/cmd/scriptorium/main.go

30 lines
714 B
Go
Raw Normal View History

2026-05-04 21:08:40 -05:00
package main
import (
"context"
"io"
2026-05-04 21:08:40 -05:00
"os"
"os/signal"
"syscall"
2026-05-04 21:08:40 -05:00
"gitea.maximumdirect.net/eric/scriptorium/internal/adapter/cli"
"go.maximumdirect.net/commandkit"
2026-05-04 21:08:40 -05:00
)
var version = "dev"
var revision = ""
2026-05-04 21:08:40 -05:00
func main() {
os.Exit(runWithSignals(os.Args[1:], os.Stdout, os.Stderr))
}
func runWithSignals(args []string, stdout, stderr io.Writer) int {
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
return run(ctx, args, stdout, stderr)
}
func run(ctx context.Context, args []string, stdout, stderr io.Writer) int {
return cli.Execute(ctx, commandkit.Identity{Name: "scriptorium", Version: version, Revision: revision}, args, stdout, stderr).Status
2026-05-04 21:08:40 -05:00
}