package main

import (
	"fmt"
	"os"

	"git.cloudinit.dev/coreci/orca/internal/cli"
)

func main() {
	os.Exit(run())
}

// run executes the orca CLI and returns the process exit code. It is
// extracted from main so tests can exercise the error path without
// os.Exit terminating the test process.
func run() int {
	if err := cli.Execute(); err != nil {
		fmt.Fprintf(os.Stderr, "error: %v\n", err)
		return 1
	}
	return 0
}
