mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-13 01:20:24 +02:00
add more coverage for --quiet cli option
This commit is contained in:
@ -1,9 +1,11 @@
|
|||||||
jc changelog
|
jc changelog
|
||||||
|
|
||||||
20240210 v1.25.1
|
20240212 v1.25.1
|
||||||
- Fix for crash when optional libraries are not installed (e.g. xmltodict)
|
- Fix for crash when optional libraries are not installed (e.g. xmltodict)
|
||||||
- Fix for `ini` parser crashing with some keys with no values
|
- Fix for `ini` parser crashing with some keys with no values
|
||||||
|
- Fix `xrandr` parser to extract more EDID data
|
||||||
- Enhance `uptime` parser to support output with no user information
|
- Enhance `uptime` parser to support output with no user information
|
||||||
|
- Enhance `--quiet` CLI option to cover more warning messages
|
||||||
- Add tests for missing optional libraries
|
- Add tests for missing optional libraries
|
||||||
- Documentation updates
|
- Documentation updates
|
||||||
|
|
||||||
|
@ -861,6 +861,9 @@ class JcCli():
|
|||||||
self.set_mono()
|
self.set_mono()
|
||||||
self.set_custom_colors()
|
self.set_custom_colors()
|
||||||
|
|
||||||
|
if self.quiet:
|
||||||
|
utils.CLI_QUIET = True
|
||||||
|
|
||||||
if self.verbose_debug:
|
if self.verbose_debug:
|
||||||
tracebackplus.enable(context=11) # type: ignore
|
tracebackplus.enable(context=11) # type: ignore
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ from functools import lru_cache
|
|||||||
from typing import Any, List, Dict, Iterable, Union, Optional, TextIO
|
from typing import Any, List, Dict, Iterable, Union, Optional, TextIO
|
||||||
from .jc_types import TimeStampFormatType
|
from .jc_types import TimeStampFormatType
|
||||||
|
|
||||||
|
CLI_QUIET = False
|
||||||
|
|
||||||
def _asciify(string: str) -> str:
|
def _asciify(string: str) -> str:
|
||||||
"""
|
"""
|
||||||
@ -62,6 +63,9 @@ def warning_message(message_lines: List[str]) -> None:
|
|||||||
|
|
||||||
None - just prints output to STDERR
|
None - just prints output to STDERR
|
||||||
"""
|
"""
|
||||||
|
if CLI_QUIET:
|
||||||
|
return
|
||||||
|
|
||||||
# this is for backwards compatibility with existing custom parsers
|
# this is for backwards compatibility with existing custom parsers
|
||||||
if isinstance(message_lines, str):
|
if isinstance(message_lines, str):
|
||||||
message_lines = [message_lines]
|
message_lines = [message_lines]
|
||||||
|
Reference in New Issue
Block a user