From 1fc4791f93c08af6917129c2a9b7f99c54f3b6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= Date: Tue, 27 Jun 2023 13:40:10 +0200 Subject: [PATCH] repoquery: --exactdeps needs --whatdepends or --whatrequires --- dnf5/commands/repoquery/repoquery.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dnf5/commands/repoquery/repoquery.cpp b/dnf5/commands/repoquery/repoquery.cpp index 56b3c8d33..3afe22a66 100644 --- a/dnf5/commands/repoquery/repoquery.cpp +++ b/dnf5/commands/repoquery/repoquery.cpp @@ -28,6 +28,7 @@ along with libdnf. If not, see . #include #include #include +#include #include #include @@ -413,6 +414,10 @@ void RepoqueryCommand::configure() { } } } + if (exactdeps->get_value() && (whatrequires->get_value().empty() && whatdepends->get_value().empty())) { + throw libdnf5::cli::ArgumentParserMissingDependentArgumentError( + M_("Option \"--exactdeps\" has to be used either with \"--whatrequires\" or \"--whatdepends\"")); + } } void RepoqueryCommand::load_additional_packages() {