From 1ec82765144fe25f847957a5d37238a0b9cbb8b7 Mon Sep 17 00:00:00 2001 From: Cristian Date: Fri, 13 Nov 2020 13:01:11 -0500 Subject: [PATCH] fix: Use a comma separated input instead of nargs for the extract flag --- archivebox/cli/archivebox_add.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/archivebox/cli/archivebox_add.py b/archivebox/cli/archivebox_add.py index 8d2d2af2..d3c89256 100644 --- a/archivebox/cli/archivebox_add.py +++ b/archivebox/cli/archivebox_add.py @@ -68,13 +68,15 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional ) parser.add_argument( "--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. \ - This does not take precedence over the configuration" + This does not take precedence over the configuration", + default="" ) command = parser.parse_args(args or ()) urls = command.urls 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): stderr( '[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, init=command.init, out_dir=pwd or OUTPUT_DIR, - extractors = command.extract or [], + extractors = extractors, )