[PR #84] Add argparse-based CLI with built-in help and validated flags #128

Open
opened 2026-05-07 00:18:48 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/84
Author: @umar1207
Created: 12/19/2025
Status: 🔄 Open

Base: mainHead: feat/cli-argeparse-support


📝 Commits (1)

  • 4f98b13 feat(cli): add argparse-based command-line interface

📊 Changes

2 files changed (+50 additions, -36 deletions)

View changed files

📝 main.py (+46 -31)
📝 src/f1_data.py (+4 -5)

📄 Description

Description
This PR introduces a proper command-line interface using argparse to improve usability and maintainability of the tool.

What changed

  1. Replaced manual sys.argv parsing with argparse.
  2. Added automatic --help output with clear flag descriptions.
  3. Centralized CLI argument parsing at the program entry point.
  4. Kept existing runtime behavior and replay logic unchanged.

Why

  1. Makes the tool self-documenting via --help.
  2. Aligns CLI handling with common open-source conventions.

Example Usage

argeparse-usage-snapshot

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/IAmTomShaw/f1-race-replay/pull/84 **Author:** [@umar1207](https://github.com/umar1207) **Created:** 12/19/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/cli-argeparse-support` --- ### 📝 Commits (1) - [`4f98b13`](https://github.com/IAmTomShaw/f1-race-replay/commit/4f98b135f0b1141e42ef4c69c4c13a01609c8b08) feat(cli): add argparse-based command-line interface ### 📊 Changes **2 files changed** (+50 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `main.py` (+46 -31) 📝 `src/f1_data.py` (+4 -5) </details> ### 📄 Description **Description** This PR introduces a proper command-line interface using argparse to improve usability and maintainability of the tool. **What changed** 1. Replaced manual sys.argv parsing with argparse. 2. Added automatic --help output with clear flag descriptions. 3. Centralized CLI argument parsing at the program entry point. 4. Kept existing runtime behavior and replay logic unchanged. **Why** 1. Makes the tool self-documenting via --help. 2. Aligns CLI handling with common open-source conventions. **Example Usage** <img width="1283" height="340" alt="argeparse-usage-snapshot" src="https://github.com/user-attachments/assets/083a29c2-9757-464a-bd73-469f6fc4f624" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/f1-race-replay#128
No description provided.