listcli

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package listcli implements the `agent-receipts list` subcommand: query recent receipts from a daemon-written SQLite store and print them in tabular or JSON form. It opens the database read-only so it is safe to run while the daemon is the active writer.

Logic lives here, away from cmd/agent-receipts/main.go, so tests can drive the subcommand directly with arbitrary args / captured I/O without shelling out to a built binary.

Index

Constants

View Source
const (
	ExitOK         = 0
	ExitUsageError = 2
)

Variables

This section is empty.

Functions

func Run

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

Run executes the list subcommand with the given args (sans the program name and "list" subcommand token), writing output to stdout and diagnostics to stderr. Returns one of the Exit* constants.

envLookup is split out so tests can inject a deterministic environment without touching the real process env. Pass os.Getenv for the production caller.

Types

This section is empty.

Jump to

Keyboard shortcuts

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