str

package
v1.11.13 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package str has string and stdout functions.

Index

Constants

View Source
const (
	NothingToDo = "  OK, nothing to do" // NothingToDo is the message when there is nothing to do.
	PrePad      = "\t  "                // PrePad is the prefix padding for stdout.
)

Variables

This section is empty.

Functions

func GetTerminalWidth added in v1.11.1

func GetTerminalWidth() (int, error)

func Month added in v1.11.1

func Month(month string) int

func PathTitle added in v1.11.1

func PathTitle(name string) string

PathTitle returns the title of the release extracted from the named directory path of the release. This is intended as a fallback when a file_id.diz cannot be parsed.

func Piped

func Piped() bool

Piped detects whether the program text is being piped to another operating system command or sent to stdout.

func Progress

func Progress(w io.Writer, name string, count, total int) float64

Progress returns the count of total remaining as a percentage.

func RemoveLine added in v1.11.1

func RemoveLine() string

func TimeTaken added in v1.11.0

func TimeTaken(w io.Writer, elapsed float64)

TimeTaken returns the elapsed time in seconds.

func Total added in v1.11.3

func Total(w io.Writer, count int, name string)

Total returns the count and name of the total number of items.

func Truncate

func Truncate(text string, length int) string

Truncate shortens a string to length characters.

func X

func X() string

X returns a red ✗ cross mark.

func Y

func Y() string

Y returns a green ✓ tick mark.

func YearAbbr added in v1.11.1

func YearAbbr(s string) int

Types

This section is empty.

Jump to

Keyboard shortcuts

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