Documentation
¶
Index ¶
- Constants
- func FormatItem(id, title string, tags []string, parts string) string
- func FormatTags(tags []string) string
- func GetTerminalWidth() int
- func PrintUnpushedWarning(count int)
- func PromptPassword() (string, error)
- func PromptPasswordCustom(prompt string) (string, error)
- func PromptPasswordWithConfirmation() (string, error)
- func PromptPasswordWithConfirmationCustom(prompt1, prompt2 string) (string, error)
- func TruncateString(s string, maxLen int) string
Constants ¶
const ( ColorTag = "\033[38;2;128;128;128m" // Muted gray for tags ColorReset = "\033[0m" // Reset to default StyleStrikethrough = "\033[9m" // Strikethrough text StyleReset = "\033[29m" // Reset strikethrough )
Color constants
const (
DefaultTermWidth = 80
)
Terminal defaults
Variables ¶
This section is empty.
Functions ¶
func FormatItem ¶
FormatItem formats item components based on what parts are requested. parts: "i" = id, "t" = title, "#" = tags Modifiers: "-" prefix = strikethrough, "+" prefix = normal (no-op) Examples: "it#" = [id] title #tags, "-it" = strikethrough [id] title, "+it#" = [id] title #tags
func FormatTags ¶
FormatTags formats a slice of tags as "#tag1 #tag2 #tag3".
func GetTerminalWidth ¶
func GetTerminalWidth() int
GetTerminalWidth returns the current terminal width, or DefaultTermWidth if unavailable.
func PrintUnpushedWarning ¶
func PrintUnpushedWarning(count int)
PrintUnpushedWarning prints a dim hint reminding the user to push.
func PromptPassword ¶
PromptPassword prompts the user for a password with hidden input.
func PromptPasswordCustom ¶
PromptPasswordCustom prompts with a custom message for password with hidden input.
func PromptPasswordWithConfirmation ¶
PromptPasswordWithConfirmation prompts twice for password confirmation.
func PromptPasswordWithConfirmationCustom ¶
PromptPasswordWithConfirmationCustom prompts twice with custom messages.
func TruncateString ¶
TruncateString truncates a string to maxLen runes (Unicode-safe).
Types ¶
This section is empty.