From 0dfb9abdc7244cf7bae178be6019f27cb56186fc Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Nov 18 2019 11:43:37 +0000 Subject: some list-pkgs options work only in combinations Fixes: https://pagure.io/koji/issue/1779 --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 48b4ac0..79cdf5f 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -2980,6 +2980,13 @@ def anon_handle_list_pkgs(goptions, session, args): opts['event'] = event['id'] event['timestr'] = time.asctime(time.localtime(event['ts'])) print("Querying at event %(id)i (%(timestr)s)" % event) + + if not opts['tagID'] and not opts['userID'] and not opts['pkgID']: + if opts['event']: + parser.error("--event and --ts makes sense only with --tag, --owner or --package") + if opts['show_blocked']: + parser.error("--show-blocked makes sense only with --tag, --owner or --package") + data = session.listPackages(**opts) if not data: print("(no matching packages)")