Skip to main content

Module style

Module style 

Source
Expand description

ANSI styling primitives and the --ansi / --no-ansi / NO_COLOR resolution chain used by the help renderer and CLI output. Terminal colors and formatting.

Default: auto-detect via stderr TTY + industry-standard env vars (NO_COLOR, FORCE_COLOR). Explicit override via --ansi/--no-ansi flags (set by main before any rendering). Falls back to plain text when piped or redirected.

Enums§

ColorChoice
Explicit color preference. Auto means “pick based on TTY + env vars”; Always / Never force the answer regardless of environment.

Functions§

bold
color_choice
Current explicit choice, or Auto when none is set.
color_enabled
Whether color output should be emitted right now.
dim
green
print_cli_error
Print a red-prefixed error: <msg> line to stderr.
red
set_color_choice
Override the auto-detected choice. Called by main after parsing --ansi / --no-ansi. Subsequent color_enabled() calls reflect the override.
yellow