mirror of
https://github.com/Garmelon/PFERD.git
synced 2026-04-13 07:55:05 +02:00
Add regex option to config and CLI parser
This commit is contained in:
parent
88afe64a92
commit
13b8c3d9c6
3 changed files with 16 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue