topmark.cli.console.click_console¶
topmark / cli / console / click_console
Click-backed console implementation for TopMark CLI output.
This module provides the primary concrete console used by CLI commands for user-facing output. It is intentionally separate from the logging subsystem.
ClickStyleKwargs ¶
Bases: TypedDict
Documented subset of keyword arguments accepted by click.style().
Console ¶
Bases: ConsoleProtocol
Program-output console, independent from the logger.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enable_color
|
bool
|
If True, enables ANSI color codes in the output. Otherwise, all output is plain text. |
True
|
out
|
TextIO | None
|
The text stream to use for standard output. Defaults to |
None
|
err
|
TextIO | None
|
The text stream to use for error output. Defaults to |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
enable_color |
bool
|
Whether to emit ANSI color codes. |
out |
TextIO | None
|
Stream for standard output (defaults to sys.stdout). |
err |
TextIO | None
|
Stream for error output (defaults to sys.stderr). |
Source code in src/topmark/cli/console/click_console.py
print ¶
Write a message to stdout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Message text. |
''
|
nl
|
bool
|
If True, append a newline. |
True
|
warn ¶
Write a warning message to stderr.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Warning text. |
required |
nl
|
bool
|
If True, append a newline. |
True
|
Source code in src/topmark/cli/console/click_console.py
error ¶
Write an error message to stderr.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Error text. |
required |
nl
|
bool
|
If True, append a newline. |
True
|