Commit fbfdbb8
authored
refactor(cli): standardize --version/-V output and remove version subcommand (#23)
<!--
SPDX-License-Identifier: MIT
SPDX-FileCopyrightText: 2025 py7zz contributors
-->
# refactor(cli): standardize --version/-V output; remove version
subcommand
## Summary
Standardizes CLI version reporting to common conventions:
`--version`/`-V` prints the plain version string only. Removes the
`py7zz version` subcommand and non‑standard fields from CLI output.
## Motivation
- Align with mainstream Python CLIs (pip, pytest, black, uv)
- Prevent environment‑dependent fields in CLI output
- Keep py7zz CLI minimal; delegate details to the Python API
## Changes
- CLI: standardize `--version`/`-V` to print only the version string;
remove `py7zz version`
- Docs: update `docs/VERSION_STRATEGY.md` examples to `--version`/`-V`
- Tests: switch CLI version tests to `--version`
- Changelog: record under Unreleased for v1.1.1
## Compatibility & Migration
- Replace any `py7zz version` usage with `py7zz --version` (or `-V`)
- For detailed metadata, use `py7zz.get_version_info()` in Python
## User Impact & Migration
- If you previously relied on `py7zz version`:
- Replace with `py7zz --version` (or `py7zz -V`).
- If you parsed extra fields from CLI output:
- Use the Python API for detailed info: `py7zz.get_version_info()`.
## Testing
- Update unit tests for CLI behavior
- Verify pre‑commit (ruff/mypy) and CI workflows pass
## Documentation
- Update version usage in `docs/VERSION_STRATEGY.md`
- No changes required to README API examples
## Changelog
- Unreleased:
- Changed: “CLI Version Command: Standardized to `--version`/`-V` and
prints only the version string.”
- Removed: “`py7zz version` subcommand and non‑standard fields from CLI
output.”
## Checklist
- [x] Conventional Commits title
- [x] Tests updated and passing
- [x] Docs updated
- [x] Changelog updated (Unreleased)
- [x] No unrelated changesFile tree
5 files changed
+32
-56
lines changed- docs
- py7zz
- tests
5 files changed
+32
-56
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
117 | | - | |
118 | | - | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | | - | |
203 | | - | |
204 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
| 209 | + | |
214 | 210 | | |
215 | 211 | | |
216 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
116 | 125 | | |
117 | 126 | | |
118 | 127 | | |
119 | | - | |
| 128 | + | |
120 | 129 | | |
121 | 130 | | |
122 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 16 | + | |
37 | 17 | | |
38 | 18 | | |
39 | 19 | | |
| |||
47 | 27 | | |
48 | 28 | | |
49 | 29 | | |
50 | | - | |
| 30 | + | |
51 | 31 | | |
52 | 32 | | |
53 | 33 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
69 | 38 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
73 | 43 | | |
74 | 44 | | |
75 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
| 285 | + | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| |||
0 commit comments