Replace manual CLI parsing with clap derive

- Add clap dependency with derive feature for structured CLI argument parsing
- Replace env::args() manual matching with clap subcommands (fetch, best, missing, wishlist, trash, details, track)
- Change print_best_car() signature from (&String, &String, &String) to (&str, &str, u8) for idiomatic Rust
- Add TODO.md tracking known tech debt and planned features
- Update CHANGELOG.md with clap migration details and set v0.2.0 release date
This commit is contained in:
Jan-Peter von Hunnius 2026-05-07 12:27:11 +02:00
parent 89fa69e3c8
commit 08c96d9981
5 changed files with 227 additions and 99 deletions

View file

@ -15,17 +15,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Data structures documentation for JSON formats
- Development setup guide with dependency explanations
- `track_names.json` — external config file mapping track codes to human-readable names (loaded at compile time via `include_str!`)
- `full_script` command for running fetch + all analysis commands in sequence
- `clap` dependency with derive feature for structured CLI argument parsing
- Daily workflow documentation with output file descriptions (`best.csv`, `details.csv`, `add.csv`, `remove.csv`, `trash.csv`, `sorted.csv`, `very_best.csv`, `wishlist.csv`)
- Test suite covering `update_best_car` logic, RQ range analysis, time validation, track name completeness, and condition completeness
### Changed
- `translate_track_name()` in `lib.rs` now loads track name mappings from `track_names.json` instead of a hardcoded match statement
- Magic number 115 replaced with `const MAX_RQ: u8 = 113` in `records.rs` for clarity and maintainability
- `parse_all_times()` now uses a semaphore (limit 20) for bounded concurrency instead of unbounded task spawning
- Replaced manual `env::args()` CLI parsing with `clap` derive for proper `--help`, `--version`, and argument validation
- `print_best_car()` signature changed from `(&String, &String, &String)` to `(&str, &str, u8)` for idiomatic Rust and compile-time RQ validation
- Empty test bodies removed from `records.rs`
- Enhanced error handling throughout the application
- Better progress reporting during data fetching
- More descriptive command-line help text
- Improved CSV output formatting
### Removed
@ -34,7 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **tracks.txt**: Removed track definitions file (only used by club binary)
- Club module `Car` struct (separate struct with `class`, `upgrade` fields)
## [0.2.0] - 2024-12-XX
## [0.2.0] - 2026-05-07
### Added
- **Track-Specific Analysis**: New `track` command for targeted recommendations
@ -213,4 +214,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
**Changelog Format**: Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format
**Versioning**: Follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html) principles
**Last Updated**: 2026-05-06
**Last Updated**: 2026-05-07