cli

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 35 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 wires the cobra command tree for the finna CLI.

Package cli — version.go is intentionally empty; the version command is implemented in ping.go as newDiagVersionCmd and wired in root.go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context) int

Execute runs the CLI; it is the single entry point from main.

func ExecuteForTest

func ExecuteForTest(t *testing.T, server, token string, args ...string) int

ExecuteForTest is a test helper that runs the CLI with controlled I/O and returns the exit code. It is only compiled when the "release" build tag is absent (i.e., always during `go test`).

func NewRootCmd

func NewRootCmd() *cobra.Command

NewRootCmd builds the root command and attaches every subcommand. It is exposed so tests can construct an independent tree.

Types

type AppState

type AppState struct {
	Cfg       *config.Config
	Effective config.Effective
	Flags     *GlobalFlags
}

AppState is built once during PersistentPreRun and made available to all subcommands via the package-level state variable.

func State

func State() *AppState

State returns the resolved app state. Subcommands call this after the root PersistentPreRun has populated it.

type GlobalFlags

type GlobalFlags struct {
	Context string
	Server  string
	Output  string
	NoColor bool
	Debug   bool
	Quiet   bool
	NoInput bool
}

GlobalFlags holds values bound to root-level persistent flags.

Jump to

Keyboard shortcuts

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