Files
notarius/internal/cli/run.go

29 lines
682 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
2026-08-25 01:55:09 +00:00
"gitea.maximumdirect.net/eric/notarius/internal/buildinfo"
"go.maximumdirect.net/commandkit"
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 {
version, err := buildinfo.Version()
if err != nil {
fmt.Fprintf(stderr, "notarius: %v\n", err)
return 1
}
app, err := NewApplication(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
}