Skip to content

Refactor argument parsing to use argparse#25

Merged
popey merged 1 commit intomainfrom
use-argparse
Nov 16, 2025
Merged

Refactor argument parsing to use argparse#25
popey merged 1 commit intomainfrom
use-argparse

Conversation

@popey
Copy link
Copy Markdown
Owner

@popey popey commented Nov 16, 2025

Refactors the CLI argument parsing to use Python's argparse module instead of manual sys.argv parsing.

Benefits:

  • More robust argument handling
  • Better help messages (automatically formatted)
  • Easier to extend with additional arguments in the future
  • Standard Python practice for CLI applications

Inspired by PR #12 from @plars. Rather than requiring a rebase of that months-old PR, I've incorporated the argparse suggestion directly while crediting Paul in the commit.

No functional changes - the CLI behavior remains the same.

Replace manual sys.argv parsing with argparse for more robust
and extensible command-line argument handling. This provides
better help messages and error handling out of the box.

Inspired by PR #12 from Paul Larson (@plars).

Co-Authored-By: Paul Larson <pwlars@gmail.com>
@popey popey mentioned this pull request Nov 16, 2025
@popey popey merged commit 9b430f1 into main Nov 16, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant