Add regex option to config and CLI parser

This commit is contained in:
I-Al-Istannen
2021-11-02 09:30:46 +01:00
parent 88afe64a92
commit 13b8c3d9c6
3 changed files with 16 additions and 2 deletions

View File

@ -14,6 +14,12 @@ GROUP = SUBPARSER.add_argument_group(
title="kit ipd crawler arguments",
description="arguments for the 'kit-ipd' crawler",
)
GROUP.add_argument(
"--link-regex",
type=str,
metavar="REGEX",
help="href-matching regex to identify downloadable files"
)
GROUP.add_argument(
"target",
type=str,
@ -41,6 +47,8 @@ def load(
section["type"] = "kit-ipd"
section["target"] = str(args.target)
section["output_dir"] = str(args.output)
if args.link_regex:
section["link_regex"] = str(args.link_regex)
SUBPARSER.set_defaults(command=load)