mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-15 07:34:27 -04:00
fix: Use a comma separated input instead of nargs for the extract flag
This commit is contained in:
parent
db523c9d82
commit
1ec8276514
1 changed files with 5 additions and 3 deletions
|
@ -68,13 +68,15 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--extract",
|
"--extract",
|
||||||
nargs="+",
|
type=str,
|
||||||
help="Pass a list of the extractors to be used. If the method name is not correct, it will be ignored. \
|
help="Pass a list of the extractors to be used. If the method name is not correct, it will be ignored. \
|
||||||
This does not take precedence over the configuration"
|
This does not take precedence over the configuration",
|
||||||
|
default=""
|
||||||
)
|
)
|
||||||
command = parser.parse_args(args or ())
|
command = parser.parse_args(args or ())
|
||||||
urls = command.urls
|
urls = command.urls
|
||||||
stdin_urls = accept_stdin(stdin)
|
stdin_urls = accept_stdin(stdin)
|
||||||
|
extractors = command.extract.split(",") if command.extract else None
|
||||||
if (stdin_urls and urls) or (not stdin and not urls):
|
if (stdin_urls and urls) or (not stdin and not urls):
|
||||||
stderr(
|
stderr(
|
||||||
'[X] You must pass URLs/paths to add via stdin or CLI arguments.\n',
|
'[X] You must pass URLs/paths to add via stdin or CLI arguments.\n',
|
||||||
|
@ -89,7 +91,7 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional
|
||||||
overwrite=command.overwrite,
|
overwrite=command.overwrite,
|
||||||
init=command.init,
|
init=command.init,
|
||||||
out_dir=pwd or OUTPUT_DIR,
|
out_dir=pwd or OUTPUT_DIR,
|
||||||
extractors = command.extract or [],
|
extractors = extractors,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue