diff --git a/CHANGELOG b/CHANGELOG index 52c69e20..7706e9f4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,9 +1,11 @@ jc changelog -20240210 v1.25.1 +20240212 v1.25.1 - Fix for crash when optional libraries are not installed (e.g. xmltodict) - 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 `--quiet` CLI option to cover more warning messages - Add tests for missing optional libraries - Documentation updates diff --git a/jc/cli.py b/jc/cli.py index e3d6d3e7..07ecd3de 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -861,6 +861,9 @@ class JcCli(): self.set_mono() self.set_custom_colors() + if self.quiet: + utils.CLI_QUIET = True + if self.verbose_debug: tracebackplus.enable(context=11) # type: ignore diff --git a/jc/utils.py b/jc/utils.py index 9ee5e765..9771af1f 100644 --- a/jc/utils.py +++ b/jc/utils.py @@ -12,6 +12,7 @@ from functools import lru_cache from typing import Any, List, Dict, Iterable, Union, Optional, TextIO from .jc_types import TimeStampFormatType +CLI_QUIET = False def _asciify(string: str) -> str: """ @@ -62,6 +63,9 @@ def warning_message(message_lines: List[str]) -> None: None - just prints output to STDERR """ + if CLI_QUIET: + return + # this is for backwards compatibility with existing custom parsers if isinstance(message_lines, str): message_lines = [message_lines]