Documentation
¶
Overview ¶
Package cli contains the cobra command tree for the compliancekit binary. Each subcommand lives in its own file (version.go, doctor.go, scan.go, ...).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BuildInfo ¶
BuildInfo carries values injected via -ldflags at build time. It's passed in from main rather than read from package-level vars so the CLI package stays testable in isolation.
type ExitCodeError ¶
ExitCodeError wraps an error that should produce a specific process exit code in main(). Used for outcomes that are not "the tool failed" but still warrant non-zero exit -- e.g. a scan that ran successfully but produced findings at or above the configured fail-on severity.
main.go checks errors.As(err, *ExitCodeError) and uses Code; cobra just sees a normal error and propagates it up.
func NewExitCode ¶
func NewExitCode(code int, format string, args ...any) *ExitCodeError
NewExitCode returns an ExitCodeError with the given exit code and a formatted message.
func (*ExitCodeError) ExitCode ¶
func (e *ExitCodeError) ExitCode() int
ExitCode returns the intended process exit code.