tools

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CancelError = errors.New("CancelError")

CancelError signals user-initiated cancellation

View Source
var SilentError = errors.New("SilentError")

SilentError is an error that triggers exit code 1 without any error messaging

Functions

func CheckDotDoko

func CheckDotDoko()

func DisplayWidth

func DisplayWidth(s string) int

DisplayWidth calculates what the rendered width of a string may be

func Files

func Files()

func Indent

func Indent(s, indent string) string

func IsUserCancellation

func IsUserCancellation(err error) bool

func MutuallyExclusive

func MutuallyExclusive(message string, conditions ...bool) error

func PrintError

func PrintError(out io.Writer, err error, cmd *cobra.Command, debug bool)

func ReplaceExcessiveWhitespace

func ReplaceExcessiveWhitespace(s string) string

func SetDefaultSettings

func SetDefaultSettings()

func SettingsContent

func SettingsContent() string

func SettingsFile

func SettingsFile() string

func Truncate

func Truncate(maxWidth int, s string) string

Truncate shortens a string to fit the maximum display width

func TruncateColumn

func TruncateColumn(maxWidth int, s string) string

TruncateColumn replaces the first new line character with an ellipsis and shortens a string to fit the maximum display width

func UpdateSettings

func UpdateSettings(ssu, sem bool)

Types

type FlagError

type FlagError struct {
	Err error
}

FlagError is the kind of error raised in flag processing

func (FlagError) Error

func (fe FlagError) Error() string

func (FlagError) Unwrap

func (fe FlagError) Unwrap() error

Jump to

Keyboard shortcuts

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