Skip to content

Commit e7715d8

Browse files
committed
Validate PDF parser CLI option
1 parent 966a6be commit e7715d8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

run_pageindex.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
parser.add_argument('--if-add-node-text', type=str, default=None,
3030
help='Whether to add text to the node')
3131
parser.add_argument('--pdf-parser', type=str, default=None,
32-
help='PDF text extractor: PyPDF2 (default), pypdfium2 (requires `pip install pypdfium2`), or PyMuPDF')
32+
choices=pageindex_utils.SUPPORTED_PDF_PARSERS,
33+
help='PDF text extractor to use')
3334

3435
# Markdown specific arguments
3536
parser.add_argument('--if-thinning', type=str, default='no',
@@ -136,4 +137,4 @@
136137
with open(output_file, 'w', encoding='utf-8') as f:
137138
json.dump(toc_with_page_number, f, indent=2, ensure_ascii=False)
138139

139-
print(f'Tree structure saved to: {output_file}')
140+
print(f'Tree structure saved to: {output_file}')

0 commit comments

Comments
 (0)