tools

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: MIT Imports: 19 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 CLIRequestFile

func CLIRequestFile(format string) string

func CheckDotResto

func CheckDotResto()

func DisplayWidth

func DisplayWidth(s string) int

DisplayWidth calculates what the rendered width of a string may be

func Exec added in v0.1.2

func Exec(shell, command string) (error, string, string)

func Files added in v0.1.6

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 RequestFile

func RequestFile() string

func SaveBuffer

func SaveBuffer(b *editor.Buffer, path string) error

func SetDefaultSettings added in v0.1.6

func SetDefaultSettings()

func SettingsContent added in v0.1.6

func SettingsContent() string

func SettingsFile added in v0.1.6

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 added in v0.1.6

func UpdateSettings(value 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