feat: Add extractor cli choice
Can only choose pdf for the time being, but allows additional extractors to be added in the future.
This commit is contained in:
parent
3b4db7b6b8
commit
f477deea7c
2 changed files with 22 additions and 5 deletions
|
|
@ -50,6 +50,18 @@ papis.config.register_default_settings(DEFAULT_OPTIONS)
|
|||
),
|
||||
help="Choose an output template to format annotations with.",
|
||||
)
|
||||
@click.option(
|
||||
"--extractor",
|
||||
"-e",
|
||||
"extractors",
|
||||
type=click.Choice(
|
||||
list(extractor.extractors.keys()),
|
||||
case_sensitive=False,
|
||||
),
|
||||
default=list(extractor.extractors.keys()),
|
||||
multiple=True,
|
||||
help="Choose an extractor to apply to the selected documents.",
|
||||
)
|
||||
@click.option(
|
||||
"--force/--no-force",
|
||||
"-f",
|
||||
|
|
@ -64,6 +76,7 @@ def main(
|
|||
doc_folder: str,
|
||||
manual: bool,
|
||||
write: bool,
|
||||
extractors: str,
|
||||
template: str,
|
||||
git: bool,
|
||||
force: bool,
|
||||
|
|
@ -86,6 +99,7 @@ def main(
|
|||
logger.warning(papis.strings.no_documents_retrieved_message)
|
||||
return
|
||||
|
||||
print(extractors)
|
||||
formatter = formatters.get(template)
|
||||
|
||||
run(documents, edit=manual, write=write, git=git, formatter=formatter, force=force)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue