cli

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cli reads command-line arguments and runs audits through the shared API. The executable supplies the API functions, so this internal package does not import the public library or maintain a separate audit implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, args []string, stdout, stderr io.Writer, api API) int

Run handles a version request or one audit command, writing output to stdout and diagnostics to stderr. It returns 0 for success, 1 for an expected mismatch, or 2 for a usage or operational error. It does not exit the calling process.

Types

type API

type API struct {
	Version       string
	LoadManifest  func(io.Reader) (contracts.Manifest, error)
	Audit         func(context.Context, contracts.Manifest, contracts.Options) (contracts.Report, error)
	WriteJSON     func(io.Writer, contracts.Report) error
	WriteMarkdown func(io.Writer, contracts.Report) error
}

API supplies the command version and the manifest loader, audit function and report writers used by both the command and library callers.

Jump to

Keyboard shortcuts

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