Documentation
¶
Overview ¶
Package cli builds the cobra command tree. Keeping the tree in a dedicated package (rather than inside cmd/hanko) makes it testable without spawning a binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrValidationFailed = errors.New("validation failed")
ErrValidationFailed is returned by subcommands that successfully ran but found rule violations. Callers (Execute, tests) distinguish this from cobra usage errors so the process exit code can reflect the difference: 1 for validation failures, 2 for bad invocation.
Functions ¶
func Execute ¶
Execute is the single entry point that cmd/hanko/main.go calls. It returns the process exit code rather than calling os.Exit so the main function is still testable.
Exit codes:
0 — no findings (or only warnings, if the caller tolerates them) 1 — validation failed (at least one error-severity finding) 2 — invocation error (bad flags, missing files, internal failure)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.