mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Add regex option to config and CLI parser
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user