cliout

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package cliout adapts keryx commands to the GTB output model.

The gtb-generated command boilerplate (v0.16.2) calls the command's RunX with (ctx, props, opts, args) — it does NOT pass the *cobra.Command, so RunX cannot read the global persistent --output flag to honour R-GLOBAL-3 (--json). Until the boilerplate threads the command (or an output writer) into RunX, this helper recovers the requested format from os.Args, which is the real invocation's source of truth. It is isolated here so the workaround is in one place and trivially swapped out later. (Logged as a gtb gap in the bug report.)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Emit

func Emit(command string, data any, text func(io.Writer)) error

Emit writes data as JSON (in --json mode) or via the text renderer otherwise. go/output dropped the Response envelope (JSON now marshals data directly), so keryx's {status, command, data} envelope is preserved explicitly here for R-GLOBAL-3 compatibility.

func Format

func Format(args []string) output.Format

Format returns the output format requested on the command line, parsing the persistent --output / -o flag out of the given args. Defaults to text.

Types

This section is empty.

Jump to

Keyboard shortcuts

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