cli

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 10 Imported by: 0

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

func Execute(stdout, stderr io.Writer, args []string) int

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL