Files
notarius/internal/cli/run.go

24 lines
566 B
Go
Raw Normal View History

2026-07-03 06:01:34 +00:00
package cli
import (
"context"
2026-07-03 06:01:34 +00:00
"fmt"
"io"
2026-07-03 17:01:24 +00:00
"go.maximumdirect.net/commandkit"
"go.maximumdirect.net/releasekit/buildinfo"
2026-07-03 06:01:34 +00:00
)
func Run(args []string, stdout, stderr io.Writer) int {
2026-07-03 17:01:24 +00:00
return RunWithOptions(args, stdout, stderr, Options{})
}
func RunWithOptions(args []string, stdout, stderr io.Writer, options Options) int {
app, err := NewApplication(buildinfo.Version(), options)
if err != nil {
fmt.Fprintf(stderr, "notarius: %v\n", err)
return 1
2026-07-03 06:01:34 +00:00
}
return app.Execute(context.Background(), args, commandkit.Streams{Out: stdout, Err: stderr}).Status
2026-07-03 06:01:34 +00:00
}