From 299829b909e18d2f046c8eb4a7c9825ed865134e Mon Sep 17 00:00:00 2001 From: Jan Kolarik Date: Tue, 4 Jun 2024 08:52:01 +0000 Subject: [PATCH] context: Set quiet mode on json output So that only the json is printed and it is parsable. --- dnf5/context.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dnf5/context.cpp b/dnf5/context.cpp index 6415db577..9a6d42015 100644 --- a/dnf5/context.cpp +++ b/dnf5/context.cpp @@ -173,7 +173,12 @@ class Context::Impl { void set_should_store_offline(bool should_store_offline) { this->should_store_offline = should_store_offline; } bool get_should_store_offline() const { return should_store_offline; } - void set_json_output_requested(bool json_output) { this->json_output = json_output; } + void set_json_output_requested(bool json_output) { + this->json_output = json_output; + if (json_output) { + set_quiet(true); + } + } bool get_json_output_requested() const { return json_output; } libdnf5::Base & get_base() { return base; };