cli: list-task --after/--before/--all

allow querying for closed tasks

Fixes: https://pagure.io/koji/issue/2565
This commit is contained in:
Tomas Kopecek 2020-11-02 09:37:57 +01:00
parent 812c1a804a
commit 0256282a84
3 changed files with 28 additions and 1 deletions

View file

@ -722,9 +722,14 @@ def _list_tasks(options, session):
"Retrieve a list of tasks"
callopts = {
'state': [koji.TASK_STATES[s] for s in ('FREE', 'OPEN', 'ASSIGNED')],
'decode': True,
}
if not options.all:
callopts['state'] = [koji.TASK_STATES[s] for s in ('FREE', 'OPEN', 'ASSIGNED')]
if options.after:
callopts['startedAfter'] = options.after
if options.before:
callopts['startedBefore'] = options.before
if getattr(options, 'mine', False):
if getattr(options, 'user', None):