shared

package
v0.10.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplySanitizedHelpFuncRecursively

func ApplySanitizedHelpFuncRecursively(cmd *cobra.Command)

func CmdCtxErr

func CmdCtxErr(cmd *cobra.Command) error

CmdCtxErr returns the error stored in the command's context with SetCmdCtxErr.

func SetCmdCtxErr

func SetCmdCtxErr(cmd *cobra.Command, err error)

SetCmdCtxErr records the error in the command's context. Use CmdCtxErr to extract the error.

func SetSanitizedHelpFunc

func SetSanitizedHelpFunc(cmd *cobra.Command)

SetSanitizedHelpFunc remove backticks from the help text when printing to the console. The backticks are there for generated Docusaurus documentation, but they are odd for a user reading the help text in the console.

func WrapText

func WrapText(text string, width int) string

WrapText wraps text by the specified width

Types

type CmdCtxKey

type CmdCtxKey string
var (
	CmdCtxKeyCmdErr CmdCtxKey = "cmdErr"
)

Directories

Path Synopsis
Package display provides interfaces and functions to format the command line output and print.
Package display provides interfaces and functions to format the command line output and print.

Jump to

Keyboard shortcuts

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