Skip to content

Fix convert.py: --global-index no longer requires --input-dir#28

Merged
ali5ter merged 1 commit into
mainfrom
fix/global-index-no-input-dir
Apr 13, 2026
Merged

Fix convert.py: --global-index no longer requires --input-dir#28
ali5ter merged 1 commit into
mainfrom
fix/global-index-no-input-dir

Conversation

@ali5ter
Copy link
Copy Markdown
Owner

@ali5ter ali5ter commented Apr 13, 2026

Summary

  • --input-dir was declared required=True in argparse, so it was validated before the --global-index early-exit could fire
  • python3 convert.py --global-index collections/ always failed with a misleading argparse error
  • Makes --input-dir optional (required=False, default None) and adds an explicit parser.error() when neither --global-index nor --input-dir is supplied

Fixes #24

Test plan

  • python3 convert.py --global-index collections/ — no longer fails with argparse error
  • python3 convert.py (no args) — still fails with actionable error message
  • python3 convert.py --input-dir collections/NAME/pdfs — normal conversion unaffected

🤖 Generated with Claude Code

argparse validated --input-dir before the --global-index early-exit
could fire, so the standalone mode always failed. Make --input-dir
optional and add an explicit check for when neither flag is supplied.

Fixes #24

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ali5ter ali5ter merged commit 168f188 into main Apr 13, 2026
@ali5ter ali5ter deleted the fix/global-index-no-input-dir branch April 13, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: --global-index requires --input-dir due to argparse required=True

1 participant