Coverage for harbor_cli/style.py: 91%
11 statements
« prev ^ index » next coverage.py v6.5.0, created at 2023-02-09 12:09 +0100
« prev ^ index » next coverage.py v6.5.0, created at 2023-02-09 12:09 +0100
1# Rich markup styles for the CLI
2from __future__ import annotations
4STYLE_CONFIG_OPTION = "italic yellow"
5"""The style used to signify a configuration file option/key/entry."""
7STYLE_CLI_OPTION = "green"
8"""The style used to signify a CLI option, e.g. --verbose."""
11def render_config_option(option: str) -> str:
12 """Render a configuration file option/key/entry."""
13 return f"[{STYLE_CONFIG_OPTION}]{option}[/]"
16def render_cli_option(option: str) -> str:
17 """Render a CLI option."""
18 return f"[{STYLE_CLI_OPTION}]{option}[/]"
21def help_config_override(option: str) -> str:
22 """Render a help string for a configuration file option/key/entry."""
23 return f"Overrides config value {render_config_option(option)}."