Files
audita/internal/cli/run.go

20 lines
423 B
Go

package cli
import (
"context"
"fmt"
"io"
commandkit "go.maximumdirect.net/commandkit"
)
// 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)
return 1
}
return app.Execute(ctx, args, commandkit.Streams{Out: stdout, Err: stderr}).Status
}