This commit is contained in:
Кокос Артем Николаевич
2026-02-05 15:31:31 +07:00
parent d7e927e6eb
commit 06cd57e2c4
14 changed files with 102 additions and 87 deletions

View File

@@ -22,32 +22,26 @@ def parse_date_range(date_arg: str) -> tuple[str, str]:
def main(argv: Optional[List[str]] = None) -> int:
parser = argparse.ArgumentParser(
prog="redmine-reporter",
description="Generate Redmine issue report based on your time entries."
description="Generate Redmine issue report based on your time entries.",
)
parser.add_argument(
"--date",
default=Config.get_default_date_range(),
# help="Date range in format YYYY-MM-DD--YYYY-MM-DD (default: %(default)s)"
help="Date range in format YYYY-MM-DD--YYYY-MM-DD (default from .env or %(default)s)"
help="Date range in format YYYY-MM-DD--YYYY-MM-DD (default from .env or %(default)s)",
)
parser.add_argument(
"--compact",
action="store_true",
help="Use compact plain-text output instead of table"
"--compact", action="store_true", help="Use compact plain-text output instead of table"
)
parser.add_argument(
"--output",
help="Path to output .odt file (e.g., report.odt). If omitted, prints to stdout."
help="Path to output .odt file (e.g., report.odt). If omitted, prints to stdout.",
)
parser.add_argument(
"--author",
default="",
help="Override author name from .env (REDMINE_AUTHOR)"
"--author", default="", help="Override author name from .env (REDMINE_AUTHOR)"
)
parser.add_argument(
"--no-time",
action="store_true",
help="Do not include spent time into table"
"--no-time", action="store_true", help="Do not include spent time into table"
)
args = parser.parse_args(argv)
@@ -80,10 +74,8 @@ def main(argv: Optional[List[str]] = None) -> int:
if args.output:
output_ext = os.path.splitext(args.output)[1].lower()
formatter = get_formatter_by_extension(output_ext,
author=Config.get_author(args.author),
from_date=from_date,
to_date=to_date
formatter = get_formatter_by_extension(
output_ext, author=Config.get_author(args.author), from_date=from_date, to_date=to_date
)
if not formatter: