Commit c3410c3
LittleCoinCoin
feat: add --version flag to CLI argument parser
Implement hatch --version command to display application version:
- Add importlib.metadata imports (version, PackageNotFoundError)
- Add get_hatch_version() helper function with error handling
- Add --version argument to main parser using argparse action='version'
The version is retrieved dynamically from package metadata via
importlib.metadata.version('hatch'). Falls back to 'unknown (development mode)'
if package is not installed.
Output format: 'hatch <version>' (e.g., 'hatch 0.6.1')
No short form (-v) to avoid conflict with existing package version flag
in subcommands.
Related to: Phase 1 analysis (version_command_analysis_v1.md)1 parent 4d06b40 commit c3410c3
1 file changed
+23
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
23 | 38 | | |
24 | 39 | | |
25 | 40 | | |
| |||
944 | 959 | | |
945 | 960 | | |
946 | 961 | | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
947 | 970 | | |
948 | 971 | | |
949 | 972 | | |
| |||
0 commit comments