Print a key-value pair with the key left-aligned to the given length, but only if the verbose flag is set.
(key: str, values: list[str], length: int)
| 158 | |
| 159 | |
| 160 | def print_key_values(key: str, values: list[str], length: int) -> None: |
| 161 | """Print a key-value pair with the key left-aligned to the given length, but only if the verbose flag is set.""" |
| 162 | if args.verbose: |
| 163 | print_ansi((key + ":").ljust(length), ANSI.fg_bright_white, ANSI.bold) |
| 164 | if len(values) == 0: |
| 165 | print("<None>") |
| 166 | else: |
| 167 | print(values[0]) |
| 168 | for value in values[1:]: |
| 169 | print(" " * length + f"{value}") |
| 170 | |
| 171 | |
| 172 | def print_error_and_exit(message: str) -> Never: |
no test coverage detected