feat(cli): add --version option 🤖🤖🤖 - #563
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #563 +/- ##
==========================================
+ Coverage 84.83% 85.50% +0.67%
==========================================
Files 33 33
Lines 5864 5866 +2
Branches 952 952
==========================================
+ Hits 4975 5016 +41
+ Misses 688 649 -39
Partials 201 201
🚀 New features to boost your workflow:
|
jatinkrmalik
left a comment
There was a problem hiding this comment.
There is a real gap on the full CLI path: main() still acquires the single-instance lock before parse_arguments(). With Vocalinux already running (the common tray case), vocalinux --version exits 1 with "Another instance is already running" and never prints the version. I reproduced that with a held flock on instance.lock.
Requested change
Please parse (or special-case --version) before acquire_lock, similar to how PR #568 by @webenefits handles --toggle / --start / --stop. A main()-level test with the lock held would lock this in.
Happy to approve once that ordering is fixed.
…on works while app is running Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
good catch, moved parse_arguments() before the lock so --version and --help work while the app is running. added a test that runs main() with the lock held and checks --version exits 0. full suite passes |
|
Thanks for the follow-up fix. Moving arg parsing before the lock check makes sense. Looks good to merge. |
Description
Add a standard
vocalinux --versionoption backed by the package's existing__version__value. The parser now also uses a stable program name so help and version output remain consistent across Python versions.Closes #555
Type of Change
Validation
PYTHONPATH=src python3 -m pytest tests/test_main_args_deps.py -q(25 passed)python3 -m py_compile src/vocalinux/main.py tests/test_main_args_deps.pyChecklist