Files
audita/internal/cli/run.go

20 lines
423 B
Go
Raw Normal View History

2026-05-10 23:12:46 +00:00
package cli
import (
2026-05-11 14:22:22 +00:00
"context"
2026-05-10 23:12:46 +00:00
"fmt"
"io"
2026-05-10 23:19:59 +00:00
commandkit "go.maximumdirect.net/commandkit"
2026-05-10 23:12:46 +00:00
)
// Run executes the application with the provided arguments and streams.
func Run(ctx context.Context, args []string, stdout, stderr io.Writer) int {
app, err := buildApplication()
if err != nil {
fmt.Fprintln(stderr, err)
2026-05-13 12:36:20 +00:00
return 1
}
return app.Execute(ctx, args, commandkit.Streams{Out: stdout, Err: stderr}).Status
2026-05-10 23:12:46 +00:00
}