Commit 02fe0e35 authored by Thomas Lotze's avatar Thomas Lotze

add filtering for a project name

parent d63064ef
......@@ -18,8 +18,12 @@ import click
'--month',
help='Filter for month (yyyy-mm)',
)
def cli(url, token, month):
entries = fetch(url, token, month)
@click.option(
'--project',
help='Filter for project name',
)
def cli(url, token, month, project):
entries = fetch(url, token, month, project)
report(entries)
......
......@@ -23,7 +23,7 @@ def parse_time(time_str):
return float(value_str) * unit
def fetch(url, token, month):
def fetch(url, token, month, project_name):
"""Yield all relevant time tracking entries, in no particular order.
"""
......@@ -31,6 +31,9 @@ def fetch(url, token, month):
projects = gitlab.projects.list(all=True)
for project in projects:
if project_name and project.name != project_name:
continue
issues = project.issues.list(all=True)
for issue in issues:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment