kongcmd

package
v0.2.0-rc.13-linux-arm64 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(target any, name, description string, stdout, stderr io.Writer) (*kong.Kong, error)

New builds a Kong parser with the standard Braidplane command metadata, writers, and exit handling used by command entrypoints.

func RecoverExit

func RecoverExit(err *error, exitError func(code int) error)

RecoverExit converts Kong's configured exit panic into the caller's error contract while preserving unrelated panics.

Types

type ParseResult

type ParseResult[T any] struct {
	CLI      T
	Context  *kong.Context
	ExitCode int
	Exited   bool
}

ParseResult captures a parsed Kong target plus any Kong-managed exit.

func Parse

func Parse[T any](
	args []string,
	cli T,
	name string,
	description string,
	stdout io.Writer,
	stderr io.Writer,
	exitError func(code int) error,
) (result ParseResult[T], err error)

Parse builds the standard parser, parses args into cli, and reports help or other Kong-managed exits without terminating the process.

Jump to

Keyboard shortcuts

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