[Feature]: Add --version flag to CLI
Summary
Add a --version flag to the oracletrace CLI so users can quickly report the installed version when opening issues or debugging.
Problem
When troubleshooting unexpected output or CI failures, it's hard to confirm which OracleTrace version is being used. There is currently no standard --version option, which creates friction for support and bug reports.
Proposed Solution
Implement a CLI flag that prints the package version and exits successfully.
- Command:
oracletrace --version - Output:
oracletrace x.y.z - Should not require a target script and should not run any tracing logic.
- (Optional) also support
-Vas an alias.
Use Case
A contributor wants to open a bug report and include the exact OracleTrace version, or a maintainer wants to quickly confirm which version is installed in a CI environment.
Example (optional)
oracletrace --version
oracletrace 2.0.1
Alternatives Considered
- Relying on
pip show oracletrace(slower, not always available in minimal environments). - Printing the version as part of
--helpoutput (less discoverable and harder to parse).
Additional Context
Implementation hint: use importlib.metadata.version("oracletrace") (Python 3.10+) and wire the flag in oracletrace/cli.py. Add a small pytest test to validate output and exit code.
Checklist
- [ x] I searched existing issues before opening this request
- [ x] I described the problem and why this feature is useful
- [ x] I provided enough detail for implementation
I am about to open a pr for this
Very nice