format

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package format provides text formatting utilities for CLI output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatRelativeTime

func FormatRelativeTime(isoString string) string

FormatRelativeTime formats a relative time string (e.g., "2 hours ago", "in 14 minutes").

func FormatSimilarity

func FormatSimilarity(similarity float64) string

FormatSimilarity formats a similarity score as a percentage.

func FormatStars

func FormatStars(count int) string

FormatStars formats a star count as "1.2k" for >= 1000, "342" for < 1000.

func RedactSensitive

func RedactSensitive(str string) string

RedactSensitive redacts sensitive information from a string.

func Separator

func Separator(width int) string

Separator returns a string of '─' characters at the given width (max 60).

func TerminalWidth

func TerminalWidth() int

TerminalWidth returns the current terminal width, defaulting to 80.

func TruncateText

func TruncateText(text string, maxLength int) string

TruncateText truncates text to a maximum length with ellipsis.

func WrapText

func WrapText(text string, maxWidth, indent int) string

WrapText wraps text at maxWidth characters, indenting continuation lines with indent spaces.

Types

This section is empty.

Jump to

Keyboard shortcuts

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