clan_cli run: add trace runOption to disable verbose traces in debug mode

This commit is contained in:
lassulus
2025-07-05 19:47:35 +02:00
parent 883cdd71d9
commit 8bbee566fc

View File

@@ -290,6 +290,7 @@ class RunOpts:
# Ask for sudo password in a graphical way.
# This is needed for GUI applications
graphical_perm: bool = False
trace: bool = True
def cmd_with_root(cmd: list[str], graphical: bool = False) -> list[str]:
@@ -344,7 +345,7 @@ def run(
# Use our sudo ask proxy here as well
options.needs_user_terminal = True
if cmdlog.isEnabledFor(logging.DEBUG):
if cmdlog.isEnabledFor(logging.DEBUG) and options.trace:
if options.input and isinstance(options.input, bytes):
if any(
not ch.isprintable() for ch in options.input.decode("ascii", "replace")